-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScreenBuffer.h
41 lines (33 loc) · 1.11 KB
/
ScreenBuffer.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
#pragma once
#include "Window.h"
#include "RenderCellData.h"
class ScreenBuffer
{
public:
ScreenBuffer ( const int x, const int y );
~ScreenBuffer ( );
WCHAR getChar ( const int x, const int y ) const;
void setChar ( const int x, const int y, char c );
void setChar ( const int x, const int y, WCHAR c );
void setCharColour ( const int x, const int y, CellColour cellColour );
void setCharColour ( const int x, const int y, CellColour foreground, CellColour background );
void setBackgroundColour ( const CellColour background );
void setForegroundColour ( const CellColour foreground );
void applyRenderData ( const int x, const int y, const unsigned int width, const unsigned int height, const pRenderCellData data );
/// <summary>
/// Sets all characters in the buffer to the space character i.e. ' '.
/// </summary>
void clearBuffer ( );
/// <summary>
/// Copies the contents of the local buffer to the output buffer
/// </summary>
void displayBuffer ( );
private:
int m_row;
int m_col;
HANDLE m_bufferHandle;
WORD m_defaultAttribute;
Window * m_window;
CHAR_INFO * m_buffer;
CHAR_INFO ** m_rowPtr;
};