aboutsummaryrefslogtreecommitdiff
path: root/screenbuffer.h
blob: 6e3d42935fe5c4120527badc2b2ae7e3cfb1efd1 (plain)
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
#pragma once

using namespace std;


class ScreenBuffer{
	int W,H;
	char *prevscreen,*screen;
	int curx=0,cury=0;

	void printstr(const char *buf);
	int printf_varargs(const char *format,va_list ap);

public:
	ScreenBuffer(int W,int H);
	~ScreenBuffer();

	void moveto(int x,int y);
	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 draw();

	void emergencyDeinit();
};