diff --git a/src/internal.c b/src/internal.c index e41c9a1..fe18342 100644 --- a/src/internal.c +++ b/src/internal.c @@ -706,6 +706,24 @@ static bool RefCountIdentity(struct List* elem, void* data) { return strcmp(data, item->id) == 0; } +SYMBOL_INTERNAL void RedrawScreen(struct Game* game) { +#ifdef LIBSUPERDERPY_IMGUI + ImGui_ImplAllegro5_NewFrame(); + igNewFrame(); +#endif + + DrawGamestates(game); + +#ifdef LIBSUPERDERPY_IMGUI + igRender(); + ImGui_ImplAllegro5_RenderDrawData(igGetDrawData()); +#endif + + DrawConsole(game); + + al_flip_display(); +} + SYMBOL_INTERNAL ALLEGRO_BITMAP* AddBitmap(struct Game* game, char* filename) { int bucket = HashString(game, filename); struct List* item = FindInList(game->_priv.bitmaps[bucket], filename, RefCountIdentity); diff --git a/src/internal.h b/src/internal.h index d30008e..ce163b4 100644 --- a/src/internal.h +++ b/src/internal.h @@ -138,5 +138,6 @@ __attribute__((__format__(__printf__, 2, 0))) char* GetGameName(struct Game* gam ALLEGRO_BITMAP* AddBitmap(struct Game* game, char* filename); void RemoveBitmap(struct Game* game, char* filename); void SetupViewport(struct Game* game); +void RedrawScreen(struct Game* game); #endif /* LIBSUPERDERPY_INTERNAL_H */