aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/core/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/core/game.cpp')
-rw-r--r--src/libjin/core/game.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libjin/core/game.cpp b/src/libjin/core/game.cpp
index b480b12..3f905f2 100644
--- a/src/libjin/core/game.cpp
+++ b/src/libjin/core/game.cpp
@@ -19,7 +19,8 @@ namespace core
void Game::run()
{
- SAFECALL(_onLoad);
+ if (_onLoad != nullptr)
+ _onLoad();
Window* wnd = Window::get();
const int FPS = wnd ? wnd->getFPS() : 60;
const int MS_PER_UPDATE = 1000.0f / FPS;
@@ -31,11 +32,12 @@ namespace core
{
while (jin::input::pollEvent(&e))
{
- SAFECALL(_onEvent, &e);
+ if (_onEvent != nullptr)
+ _onEvent(&e);
if (!_running) goto quitloop;
}
- SAFECALL(_onUpdate, dt);
- SAFECALL(_onDraw);
+ if (_onUpdate != nullptr) _onUpdate(dt);
+ if (_onDraw != nullptr) _onDraw();
wnd->swapBuffers();
const int current = getMilliSecond();
dt = current - previous;