aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/core')
-rw-r--r--src/libjin/core/game.cpp2
-rw-r--r--src/libjin/core/game.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/libjin/core/game.cpp b/src/libjin/core/game.cpp
index ffd8015..929cc07 100644
--- a/src/libjin/core/game.cpp
+++ b/src/libjin/core/game.cpp
@@ -19,6 +19,7 @@ namespace core
void Game::run()
{
+ SAFECALL(_onLoad);
Window* wnd = Window::get();
const int FPS = wnd ? wnd->getFPS() : 60;
const int MS_PER_UPDATE = 1000.0f / FPS;
@@ -59,6 +60,7 @@ namespace core
_onEvent = s->eventHandler;
_onUpdate = s->updater;
_onDraw = s->drawer;
+ _onLoad = s->loader;
return true;
}
diff --git a/src/libjin/core/game.h b/src/libjin/core/game.h
index 090e7c6..9359487 100644
--- a/src/libjin/core/game.h
+++ b/src/libjin/core/game.h
@@ -16,6 +16,7 @@ namespace core
{
public:
+ typedef void(*onLoad)();
typedef void(*onEvent)(jin::input::Event* e);
typedef void(*onUpdate)(float dt);
typedef void(*onDraw)();
@@ -25,6 +26,7 @@ namespace core
onEvent eventHandler;
onUpdate updater;
onDraw drawer;
+ onLoad loader;
};
void run();
@@ -38,9 +40,10 @@ namespace core
SINGLETON(Game);
- onEvent _onEvent;
+ onEvent _onEvent;
onUpdate _onUpdate;
- onDraw _onDraw;
+ onDraw _onDraw;
+ onLoad _onLoad;
bool _running;