don't react to ALLEGRO_EVENT_DISPLAY_RESIZE if the new size is the same as the old one

This commit is contained in:
Sebastian Krzyszkowiak 2019-02-19 03:49:53 +01:00
parent 199ad64bac
commit 7c89ef74e2
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -49,14 +49,16 @@ static inline void HandleEvent(struct Game* game, ALLEGRO_EVENT* ev) {
break;
case ALLEGRO_EVENT_DISPLAY_RESIZE:
if ((ev->display.width != al_get_display_width(game->display)) || (ev->display.height != al_get_display_height(game->display))) {
#ifdef LIBSUPERDERPY_IMGUI
ImGui_ImplAllegro5_InvalidateDeviceObjects();
ImGui_ImplAllegro5_InvalidateDeviceObjects();
#endif
al_acknowledge_resize(game->display);
al_acknowledge_resize(game->display);
#ifdef LIBSUPERDERPY_IMGUI
ImGui_ImplAllegro5_CreateDeviceObjects();
ImGui_ImplAllegro5_CreateDeviceObjects();
#endif
SetupViewport(game);
SetupViewport(game);
}
break;
case ALLEGRO_EVENT_KEY_DOWN: