#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(); };