From ce79d8d4ff1d228c624e7212a74b0554c662061a Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 21 Mar 2025 16:43:52 -0500 Subject: [PATCH] refactoring --- modules/Window/src/WindowModule.cpp | 12 +++++++++--- modules/Window/src/WindowModule.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/Window/src/WindowModule.cpp b/modules/Window/src/WindowModule.cpp index d404752..7567916 100644 --- a/modules/Window/src/WindowModule.cpp +++ b/modules/Window/src/WindowModule.cpp @@ -1,12 +1,18 @@ #include "WindowModule.h" -WindowModule::WindowModule(void* h, App& a) : Module(h, a) { +WindowModule::WindowModule(void* h, Archimedes::App& a) : Module(h, a) { name = "Window"; } -WindowModule::~WindowModule() {} +WindowModule::~WindowModule() { + if(window) + delete window; +} -void WindowModule::onLoad() {} +void WindowModule::onLoad() { + + window = new Archimedes::Window(); +} void WindowModule::run() { diff --git a/modules/Window/src/WindowModule.h b/modules/Window/src/WindowModule.h index e36214b..8574f7e 100644 --- a/modules/Window/src/WindowModule.h +++ b/modules/Window/src/WindowModule.h @@ -15,7 +15,7 @@ class WindowModule : public Archimedes::Module { private: - Archimedes::Window window; + Archimedes::Window* window; };