-
Notifications
You must be signed in to change notification settings - Fork 0
/
window.h
38 lines (34 loc) · 794 Bytes
/
window.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
#pragma once
#include <windows.h>
class Window {
private:
HANDLE console;
CHAR_INFO* buffer;
short dimension;
COORD bufferSize;
SMALL_RECT winRect;
public:
Window(short dimension, short fontSize);
void DrawPixel(short x, short y, short color = 15);
void Clear(short color = 2);
void Render();
inline short GetDimension() const { return dimension; }
private:
void SetFontSize(short size);
void SetWindowDimension(short dimension);
};
extern "C" {
struct CONSOLE_FONT_INFOEX {
ULONG cbSize;
DWORD nFont;
COORD dwFontSize;
UINT FontFamily;
UINT FontWeight;
WCHAR FaceName[LF_FACESIZE];
};
BOOL WINAPI SetCurrentConsoleFontEx(
HANDLE hConsoleOutput,
BOOL bMaximumWindow,
CONSOLE_FONT_INFOEX* lpConsoleCurrentFontEx
);
}