make sure to redraw the gamestates after a resize

Also affects compositor toggling
This commit is contained in:
Sebastian Krzyszkowiak 2019-03-05 03:48:11 +01:00
parent c7ebc51f16
commit 5a6e212de1
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
3 changed files with 7 additions and 2 deletions

View file

@ -178,6 +178,9 @@ SYMBOL_INTERNAL void ResizeGamestates(struct Game* game) {
game->_priv.loading.gamestate->fb = al_create_sub_bitmap(al_get_backbuffer(game->display), game->clip_rect.x, game->clip_rect.y, game->clip_rect.w, game->clip_rect.h);
}
}
if (game->_priv.started) {
DrawGamestates(game);
}
}
SYMBOL_INTERNAL int SetupAudio(struct Game* game) {

View file

@ -87,8 +87,10 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
game->_priv.garbage = NULL;
game->_priv.timelines = NULL;
game->_priv.shaders = NULL;
game->_priv.gamestates = NULL;
game->_priv.paused = false;
game->_priv.started = false;
game->_priv.texture_sync = false;
game->_priv.texture_sync_cond = al_create_cond();
@ -291,8 +293,6 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
al_add_new_bitmap_flag(ALLEGRO_MIN_LINEAR | ALLEGRO_MAG_LINEAR);
game->_priv.gamestates = NULL;
al_init_user_event_source(&(game->event_source));
game->_priv.event_queue = al_create_event_queue();
@ -384,6 +384,7 @@ SYMBOL_EXPORT int libsuperderpy_start(struct Game* game) {
game->_priv.timestamp = al_get_time();
game->_priv.paused = false;
game->_priv.started = true;
#ifdef LIBSUPERDERPY_IMGUI
igCreateContext(NULL);

View file

@ -229,6 +229,7 @@ struct Game {
double timestamp;
bool paused;
bool started;
volatile bool texture_sync;
ALLEGRO_MUTEX* texture_sync_mutex;