Retro68/App2/Console.h

32 lines
502 B
C
Raw Normal View History

2012-03-29 10:31:05 +02:00
#include <Quickdraw.h>
#include <vector>
2012-03-30 10:01:55 +02:00
#include <string>
2012-03-29 10:31:05 +02:00
class Console
{
public:
2012-04-06 01:43:44 +02:00
Console(GrafPtr port, Rect r);
2012-03-29 10:31:05 +02:00
void Draw();
void putch(char c);
2012-03-30 10:01:55 +02:00
std::string ReadLine();
2012-03-29 10:31:05 +02:00
static Console *currentInstance;
private:
GrafPtr consolePort;
Rect bounds;
std::vector<char> chars;
short cellSizeX;
short cellSizeY;
short rows, cols;
short cursorX, cursorY;
Rect CellRect(short x, short y);
void DrawCell(short x, short y);
void ScrollUp(short n = 1);
};