aboutsummaryrefslogtreecommitdiff
path: root/screenbuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'screenbuffer.h')
-rw-r--r--screenbuffer.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/screenbuffer.h b/screenbuffer.h
index 7a2883e..a461145 100644
--- a/screenbuffer.h
+++ b/screenbuffer.h
@@ -6,13 +6,26 @@ using namespace std;
class ScreenBuffer{
+ struct Style{
+ int fg=9,bg=9;
+ };
+
+ struct Cell{
+ char c=' ';
+ Style style;
+ };
+
int W,H;
- char *prevscreen,*screen;
+ Cell *prevscreen,*screen;
int curx=0,cury=0;
+ Style curstyle;
void printstr(const char *buf);
int printf_varargs(const char *format,va_list ap);
+ friend bool operator!=(const ScreenBuffer::Style &a,const ScreenBuffer::Style &b);
+ friend bool operator!=(const ScreenBuffer::Cell &a,const ScreenBuffer::Cell &b);
+
public:
ScreenBuffer(int W,int H);
~ScreenBuffer();
@@ -21,6 +34,9 @@ public:
int printf(const char *format,...) __attribute__((format (printf, 2, 3)));
int mvprintf(int x,int y,const char *format,...) __attribute__((format (printf, 4, 5)));
+ void setfg(int fg);
+ void setbg(int bg);
+
void draw();
void emergencyDeinit();