From a64ab82e41f005b6c5f93526ed958221fc22d84c Mon Sep 17 00:00:00 2001 From: Tristan Cormier Date: Tue, 4 Nov 2025 09:32:33 -0500 Subject: [PATCH] feat(console): add ConsoleDeviceExists --- src/console/Device.cpp | 7 ++++++- src/console/Device.hpp | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/console/Device.cpp b/src/console/Device.cpp index a33d809..986a66c 100644 --- a/src/console/Device.cpp +++ b/src/console/Device.cpp @@ -6,6 +6,7 @@ #include "gx/Device.hpp" #include +static CGxDevice* s_device; CVar* s_cvGxMaximize; CVar* s_cvGxResolution; CVar* s_cvGxWidescreen; @@ -198,7 +199,7 @@ void ConsoleDeviceInitialize(const char* title) { api = GxApi_GLL; #endif - CGxDevice* device = GxDevCreate(api, OsWindowProc, format); + s_device = GxDevCreate(api, OsWindowProc, format); // TODO @@ -207,3 +208,7 @@ void ConsoleDeviceInitialize(const char* title) { // TODO } + +int32_t ConsoleDeviceExists() { + return s_device != nullptr; +} diff --git a/src/console/Device.hpp b/src/console/Device.hpp index a958f38..57f5750 100644 --- a/src/console/Device.hpp +++ b/src/console/Device.hpp @@ -9,4 +9,6 @@ struct DefaultSettings { void ConsoleDeviceInitialize(const char* title); +int32_t ConsoleDeviceExists(); + #endif