feat(console): limited console implementation

This commit is contained in:
phaneron 2023-08-16 16:37:38 -04:00
parent 9c3bc2203d
commit 384e52c7d1
31 changed files with 1370 additions and 47 deletions

View file

@ -1,8 +1,13 @@
#include "console/Console.hpp"
#include "event/Context.hpp"
#include "event/Event.hpp"
static int32_t s_active;
static int32_t s_consoleAccessEnabled;
static KEY s_consoleKey = KEY_TILDE;
static float s_consoleLines = 10.0f;
static float s_fontHeight = 0.02f;
static float s_consoleHeight = s_consoleLines * s_fontHeight;
static CONSOLERESIZESTATE s_consoleResizeState = CS_NONE;
int32_t ConsoleAccessGetEnabled() {
@ -17,6 +22,18 @@ int32_t ConsoleGetActive() {
return s_active;
}
float ConsoleGetFontHeight() {
return s_fontHeight;
}
float ConsoleGetHeight() {
return s_consoleHeight;
}
float ConsoleGetLines() {
return s_consoleLines;
}
KEY ConsoleGetHotKey() {
return s_consoleKey;
}
@ -36,3 +53,11 @@ void ConsoleSetHotKey(KEY hotkey) {
void ConsoleSetResizeState(CONSOLERESIZESTATE state) {
s_consoleResizeState = state;
}
void ConsoleSetHeight(float height) {
s_consoleHeight = height;
}
void ConsolePostClose() {
EventPostCloseEx(EventGetCurrentContext());
}