From 3a996038684ed3d358259de6cde2f166dddaa04a Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Wed, 19 Feb 2025 09:30:25 -0500 Subject: Updating themes so that they work again --- themes/src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'themes/src/main.cpp') diff --git a/themes/src/main.cpp b/themes/src/main.cpp index 14227c9..d9cfc01 100644 --- a/themes/src/main.cpp +++ b/themes/src/main.cpp @@ -67,14 +67,19 @@ void load(ThemeType theme) { } void update(f32 dtSeconds, void* userData) { + if (!active_theme) + return; active_theme->update(dtSeconds); active_theme->render(); } void unload() { delete active_theme; + active_theme = nullptr; type = ThemeType::Default; + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); if (mainLoop.isRunning) { mainLoop.stop(); } @@ -84,7 +89,7 @@ void unload() { EM_BOOL selectNone(int eventType, const EmscriptenMouseEvent* mouseEvent, void* userData) { printf("Default theme selected\n"); unload(); - return true; + return true; } EM_BOOL selectAutumn(int eventType, const EmscriptenMouseEvent* mouseEvent, void* userData) { -- cgit v1.2.1