Use scene for draw & update calls instead of app
This commit is contained in:
parent
3dd8f3db61
commit
ac505229ae
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue