restructure modules. make GuiModules depend on WindowModule
This commit is contained in:
24
modules/WindowModule/src/WindowModule.cpp
Normal file
24
modules/WindowModule/src/WindowModule.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "WindowModule.h"
|
||||
|
||||
WindowModule::WindowModule(void* h, Archimedes::App* a) : Module(h, a) {
|
||||
name = "Window";
|
||||
}
|
||||
|
||||
WindowModule::~WindowModule() {
|
||||
if(window)
|
||||
delete window;
|
||||
}
|
||||
|
||||
void WindowModule::onLoad() {
|
||||
|
||||
window = new Archimedes::Window();
|
||||
}
|
||||
|
||||
void WindowModule::run() {
|
||||
|
||||
if(window->shouldClose()) {
|
||||
app->end();
|
||||
}
|
||||
|
||||
window->doFrame();
|
||||
}
|
||||
25
modules/WindowModule/src/WindowModule.h
Normal file
25
modules/WindowModule/src/WindowModule.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "Archimedes.h"
|
||||
#include "utils/Window/Window.h"
|
||||
#include "utils/Renderer/Renderer.h"
|
||||
|
||||
class WindowModule : public Archimedes::Module {
|
||||
|
||||
public:
|
||||
WindowModule(void*, Archimedes::App*);
|
||||
|
||||
~WindowModule();
|
||||
|
||||
void run();
|
||||
|
||||
void onLoad();
|
||||
|
||||
private:
|
||||
|
||||
Archimedes::Window* window;
|
||||
};
|
||||
|
||||
|
||||
#ifndef WINDOW_STATIC
|
||||
#define MODULE_TYPE WindowModule
|
||||
#include "endModule.h"
|
||||
#endif
|
||||
Reference in New Issue
Block a user