internal: Add RedrawScreen function

This commit is contained in:
Sebastian Krzyszkowiak 2020-11-07 06:23:28 +01:00
parent d25d7ee5b9
commit c94acb7fc3
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
2 changed files with 19 additions and 0 deletions

View file

@ -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);

View file

@ -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 */