(GDI) Only render framebuffer texture when menu is enabled

This commit is contained in:
twinaphex 2020-07-09 09:40:13 +02:00
parent 35762e07cb
commit 77d630a0a5
2 changed files with 17 additions and 2 deletions

View File

@ -48,6 +48,9 @@ typedef struct gdi
bool lte_win98; bool lte_win98;
unsigned short *temp_buf; unsigned short *temp_buf;
unsigned char *menu_frame; unsigned char *menu_frame;
bool menu_enable;
bool menu_full_screen;
} gdi_t; } gdi_t;
typedef struct gdi_texture typedef struct gdi_texture

View File

@ -317,7 +317,8 @@ static bool gdi_gfx_frame(void *data, const void *frame,
return true; return true;
#ifdef HAVE_MENU #ifdef HAVE_MENU
menu_driver_frame(menu_is_alive, video_info); if (gdi->menu_enable)
menu_driver_frame(menu_is_alive, video_info);
#endif #endif
if ( gdi->video_width != frame_width || if ( gdi->video_width != frame_width ||
@ -574,6 +575,17 @@ static bool gdi_gfx_set_shader(void *data,
return false; return false;
} }
static void gdi_set_texture_enable(
void *data, bool state, bool full_screen)
{
gdi_t *gdi = (gdi_t*)data;
if (!gdi)
return;
gdi->menu_enable = state;
gdi->menu_full_screen = full_screen;
}
static void gdi_set_texture_frame(void *data, static void gdi_set_texture_frame(void *data,
const void *frame, bool rgb32, unsigned width, unsigned height, const void *frame, bool rgb32, unsigned width, unsigned height,
float alpha) float alpha)
@ -694,7 +706,7 @@ static const video_poke_interface_t gdi_poke_interface = {
NULL, NULL,
NULL, NULL,
gdi_set_texture_frame, gdi_set_texture_frame,
NULL, gdi_set_texture_enable,
font_driver_render_msg, font_driver_render_msg,
NULL, NULL,
NULL, /* grab_mouse_toggle */ NULL, /* grab_mouse_toggle */