diff options
Diffstat (limited to 'src/libjin/Core')
-rw-r--r-- | src/libjin/Core/Game.cpp | 2 | ||||
-rw-r--r-- | src/libjin/Core/Game.h | 7 |
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; |