restructure modules. make GuiModules depend on WindowModule
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
#undef GUIMODULE
|
#undef GUIMODULE
|
||||||
|
|
||||||
#include "utils/Module/Module.h"
|
#include "utils/Module/Module.h"
|
||||||
#include "utils/Window/Window.h"
|
#include "modules/WindowModule/src/WindowModule.h"
|
||||||
|
|
||||||
namespace Archimedes {
|
namespace Archimedes {
|
||||||
|
|
||||||
@@ -11,7 +11,10 @@ namespace Archimedes {
|
|||||||
public:
|
public:
|
||||||
typedef GuiModule* create_t(void*, App*);
|
typedef GuiModule* create_t(void*, App*);
|
||||||
|
|
||||||
GuiModule(void* h, App* a) : Module(h, a) {}
|
GuiModule(void* h, App* a) : Module(h, a) {
|
||||||
|
window = new WindowModule(nullptr, a);
|
||||||
|
deps["WindowModule"] = window;
|
||||||
|
}
|
||||||
virtual ~GuiModule() { if(window) delete window; }
|
virtual ~GuiModule() { if(window) delete window; }
|
||||||
virtual void onLoad() = 0;
|
virtual void onLoad() = 0;
|
||||||
virtual void run() = 0;
|
virtual void run() = 0;
|
||||||
@@ -20,7 +23,7 @@ namespace Archimedes {
|
|||||||
void createWindow() { window = new Window(); }
|
void createWindow() { window = new Window(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Window* window;
|
WindowModule* window;
|
||||||
//Renderer* renderer;
|
//Renderer* renderer;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "WindowModule.h"
|
#include "WindowModule.h"
|
||||||
|
|
||||||
WindowModule::WindowModule(void* h, Archimedes::App& a) : Module(h, a) {
|
WindowModule::WindowModule(void* h, Archimedes::App* a) : Module(h, a) {
|
||||||
name = "Window";
|
name = "Window";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ void WindowModule::onLoad() {
|
|||||||
void WindowModule::run() {
|
void WindowModule::run() {
|
||||||
|
|
||||||
if(window->shouldClose()) {
|
if(window->shouldClose()) {
|
||||||
app.end();
|
app->end();
|
||||||
}
|
}
|
||||||
|
|
||||||
window->doFrame();
|
window->doFrame();
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
class WindowModule : public Archimedes::Module {
|
class WindowModule : public Archimedes::Module {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WindowModule(void*, Archimedes::App&);
|
WindowModule(void*, Archimedes::App*);
|
||||||
|
|
||||||
~WindowModule();
|
~WindowModule();
|
||||||
|
|
||||||
@@ -19,8 +19,7 @@ class WindowModule : public Archimedes::Module {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
#ifndef WINDOW_STATIC
|
||||||
Archimedes::Module* create(void* handle, Archimedes::App& app) {
|
#define MODULE_TYPE WindowModule
|
||||||
return new WindowModule(handle, app);
|
#include "endModule.h"
|
||||||
}
|
#endif
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user