Use scene for draw & update calls instead of app

This commit is contained in:
Nikita Lisitsa 2020-08-30 21:22:12 +03:00
parent 3dd8f3db61
commit ac505229ae

View file

@ -189,6 +189,10 @@ namespace psemek::app
impl().running = true;
while (running())
{
scene * handler = this;
if (impl().current_scene)
handler = impl().current_scene;
poll_events();
if (!impl().had_initial_resize)
{
@ -198,8 +202,8 @@ namespace psemek::app
on_resize(w, h);
}
if (!running()) break;
update();
draw();
handler->update();
handler->draw();
SDL_GL_SwapWindow(impl().window);
}