diff options
author | Matthew Kosarek <matt.kosarek@canonical.com> | 2025-02-19 09:30:25 -0500 |
---|---|---|
committer | Matthew Kosarek <matt.kosarek@canonical.com> | 2025-02-19 09:30:25 -0500 |
commit | 3a996038684ed3d358259de6cde2f166dddaa04a (patch) | |
tree | 73b1978efb2ecdb39936b804920e3006c32f07f2 /themes/src | |
parent | 5875b89ed114ee7a912167b5a609d1cf1da54a53 (diff) |
Diffstat (limited to 'themes/src')
-rw-r--r-- | themes/src/MainLoop.h | 2 | ||||
-rw-r--r-- | themes/src/main.cpp | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/themes/src/MainLoop.h b/themes/src/MainLoop.h index 2573bb8..07520a2 100644 --- a/themes/src/MainLoop.h +++ b/themes/src/MainLoop.h @@ -26,4 +26,4 @@ struct MainLoop { void stop() { isRunning = false; } -};
\ No newline at end of file +}; 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) { |