-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConsoleHeader.h
92 lines (69 loc) · 1.75 KB
/
ConsoleHeader.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef RR_CONSOLEHEADER
#define RR_CONSOLEHEADER
enum HistoryEntryEnum
{
HistoryEntry_Default,
HistoryEntry_Command,
HistoryEntry_Error,
};
static String OSGetClipBoard();
static void OSSetClipBoard(String string);
struct HistoryEntry
{
String entry;
HistoryEntryEnum flag;
};
struct ConsoleCommand
{
String name;
void(*interp)(StringArray args);
u32 minArgs;
u32 maxArgs;
};
DefineArray(ConsoleCommand);
struct Console
{
f32 fontSize = 0.023f;
f32 openness = 0.0f;
f32 dt = 1.5f;
f32 intendedOpenness = 0.0f;
f32 textInputFieldSize = 0.03f;
String inputString;
u32 maxInputStringLength = 200;
f32 typeFieldTextScrollOffset = 0.0f;
f32 typeFieldXOffset = 0.015f;
Char *buffer;
u32 bufferSize = 80000;
Arena *arena;
HistoryEntry *history;
u32 maxHistoryLength = 300;
u32 historyLength = 0;
String *commandHistory;
u32 maxCommandHistoryLength = 200;
u32 commandHistoryLength = 0;
u32 recallHistoryPos = 0;
u32 historyPos = 0;
f32 historyXOffset = 0.03f;
f32 openWide = 1.0f;
f32 open = 0.3f;
u32 cursorPos = 0;
f32 cursorScrollEdge = 0.1f;
f32 cursorTimer = 0.0f;
f32 cursorWidth = 0.001f;
u32 firstSelectPos = 0;
u32 endSelectPos = 0;
b32 selecting = false;
f32 scrollbarWidth = 0.02f;
b32 scrollingScrollbar = false;
i8 backLayer = 2;
i8 middleLayer = 1;
i8 textLayer = 0;
i8 selectionLayer = -1;
ConsoleCommandArray commands;
};
static Console console;
static void ConsoleOutput(char* format, ...);
static void ConsoleOutputError(char *format, ...);
static void ConsoleOutputError(String toPrint);
static void ConsoleOutput(String toPrint);
#endif // !RR_ConsoleHeader