Fix scene resize if scene changed when processing events
This commit is contained in:
parent
eb67ee846d
commit
695da47ade
1 changed files with 3 additions and 2 deletions
|
|
@ -189,17 +189,18 @@ namespace psemek::app
|
|||
impl().running = true;
|
||||
while (running())
|
||||
{
|
||||
poll_events();
|
||||
|
||||
scene * handler = this;
|
||||
if (impl().current_scene)
|
||||
handler = impl().current_scene;
|
||||
|
||||
poll_events();
|
||||
if (!impl().had_initial_resize)
|
||||
{
|
||||
int w, h;
|
||||
SDL_GetWindowSize(impl().window, &w, &h);
|
||||
impl().had_initial_resize = true;
|
||||
on_resize(w, h);
|
||||
handler->on_resize(w, h);
|
||||
}
|
||||
if (!running()) break;
|
||||
handler->update();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue