gfx: Provide functions for fullscreen handling

This commit is contained in:
Xavier Del Campo Romero 2022-09-23 04:12:56 +02:00
parent 9d3e754f36
commit d0089e7ddf
3 changed files with 22 additions and 0 deletions

View File

@ -13,6 +13,8 @@ extern "C"
int gfx_init(void);
int gfx_draw(void);
int gfx_toggle_fullscreen(void);
bool gfx_toggle_fullscreen_available(void);
bool gfx_fullscreen(void);
void sprite_sort(struct sprite *s);
int sprite_clone(const struct sprite *src, struct sprite *dst);
void rect_init(struct rect *r);

View File

@ -38,6 +38,16 @@ int gfx_toggle_fullscreen(void)
return -1;
}
bool gfx_toggle_fullscreen_available(void)
{
return false;
}
bool gfx_fullscreen(void)
{
return true;
}
bool gfx_inside_drawenv(const short x, const short y, const short w,
const short h)
{

View File

@ -163,6 +163,16 @@ int gfx_toggle_fullscreen(void)
return 0;
}
bool gfx_toggle_fullscreen_available(void)
{
return true;
}
bool gfx_fullscreen(void)
{
return fullscreen;
}
int gfx_draw(void)
{
enum {FPS = 50, REFRESH_MS = 1000 / FPS};