work on main app
This commit is contained in:
@@ -4,13 +4,21 @@ WindowModule::WindowModule(void* h, App& a) : Module(h, a) {
|
||||
name = "Window";
|
||||
}
|
||||
|
||||
WindowModule::~WindowModule() {}
|
||||
WindowModule::~WindowModule() {
|
||||
delete window;
|
||||
delete renderer;
|
||||
}
|
||||
|
||||
void WindowModule::onLoad() {
|
||||
window = new Window();
|
||||
renderer = new Renderer();
|
||||
}
|
||||
|
||||
void WindowModule::run() {
|
||||
|
||||
if(window.shouldClose()) {
|
||||
app.stopModule(self);
|
||||
if(window->shouldClose()) {
|
||||
app.end();
|
||||
}
|
||||
|
||||
window.doFrame();
|
||||
window->doFrame();
|
||||
}
|
||||
|
||||
@@ -11,11 +11,13 @@ class WindowModule : public Module {
|
||||
|
||||
void run();
|
||||
|
||||
void onLoad();
|
||||
|
||||
private:
|
||||
|
||||
Window window;
|
||||
Window* window;
|
||||
|
||||
Renderer renderer;
|
||||
Renderer* renderer;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user