-
Notifications
You must be signed in to change notification settings - Fork 3
/
gui.h
58 lines (47 loc) · 950 Bytes
/
gui.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include <lib.h>
namespace gui
{
inline bool bInit = false;
inline bool bDetached = false;
inline bool bShowMain = false;
inline bool bTestWindow = false;
struct bWindowStruct
{
bool bShow;
cVec2 vecWindowPos;
void(__stdcall* render)(bWindowStruct*);
bWindowStruct()
{
bShow = false;
render = nullptr;
}
bWindowStruct(void(__stdcall* render)(bWindowStruct*)) : render(render)
{
bShow = false;
};
void Draw()
{
if (bShow && render && bShowMain)
render(this);
}
};
inline lib::StaticArray<bWindowStruct, 8> windows;
inline void HideAllWindows(bWindowStruct *exception = nullptr)
{
for (auto& window : windows)
{
if (&window != exception)
window.bShow = false;
}
}
void RenderWindow();
namespace OnReset
{
void Before();
void After();
}
void LoadStyle();
void setGUIWindows();
void OnEndScene();
}