/
console.h
executable file
·53 lines (46 loc) · 1.14 KB
/
console.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef BAZINGA_CONSOLE_H
#define BAZINGA_CONSOLE_H
#include "bazinga.h"
#include "text.h"
#include <string>
#include <sstream>
using namespace std;
#define LINEINFO Path(__FILE__).getName()<<": "<<__func__<<": "<<__LINE__<<": "
namespace bazinga {
// Debugging console.
// implemented because GUI was giving me a lot of headcache
// So I needed some way of looking at variables.
const static string outline = "\n";
class Console {
public:
class Message {
float time;
string text;
int number;
public:
Message(string);
string getString();
string getText();
void increaseNumber();
};
private:
bool manualScrolling;
int offset;
int lineHeight;
vector <Message> messages;
string line;
public:
Console();
void init();
void log(string);
string toStr(float);
Console& operator<< (const string&);
Console& operator<< (const float&);
void up();
void down();
void render();
void deinit();
};
extern Console console;
}
#endif /* BAZINGA_CONSOLE_H */