diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index e6bc444c44..ccab864797 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -1107,7 +1107,6 @@ static void browser_render(void *data) menu_panel->y = y_increment; menu_panel->width = 510; menu_panel->height = 20; - texture_image_render(menu_panel); } #endif @@ -2581,7 +2580,6 @@ static int select_setting(uint8_t menu_type, uint64_t input) menu_panel->y = y_increment; menu_panel->width = 510; menu_panel->height = 20; - texture_image_render(menu_panel); #endif font_parms.x = POSITION_X; diff --git a/xdk/xdk_d3d.cpp b/xdk/xdk_d3d.cpp index f48c9d80e3..4030183326 100644 --- a/xdk/xdk_d3d.cpp +++ b/xdk/xdk_d3d.cpp @@ -731,6 +731,10 @@ bool texture_image_render(struct texture_image *out_img) #if defined(HAVE_RGUI) || defined(HAVE_RMENU) +#ifdef HAVE_MENU_PANEL +extern struct texture_image *menu_panel; +#endif + static inline void xdk_d3d_draw_texture(void *data) { xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data; @@ -741,11 +745,23 @@ static inline void xdk_d3d_draw_texture(void *data) menu_texture->x = 0; menu_texture->y = 0; - d3d->d3d_render_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); - d3d->d3d_render_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, true); - texture_image_render(menu_texture); - d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, false); + if (d3d->rgui_texture_enable) + { + d3d->d3d_render_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); + d3d->d3d_render_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, true); + texture_image_render(menu_texture); + d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, false); + } + +#ifdef HAVE_MENU_PANEL + if ((menu_panel->x != 0) || (menu_panel->y != 0)) + { + texture_image_render(menu_panel); + menu_panel->x = 0; + menu_panel->y = 0; + } +#endif #endif } #endif @@ -918,8 +934,6 @@ static bool xdk_d3d_frame(void *data, const void *frame, #if defined(HAVE_RGUI) || defined(HAVE_RMENU) #ifdef HAVE_RMENU_XUI if (lifecycle_mode_state & (1ULL << MODE_MENU_DRAW)) -#else - if (d3d->rgui_texture_enable) #endif xdk_d3d_draw_texture(d3d); #endif @@ -969,8 +983,7 @@ static bool xdk_d3d_frame(void *data, const void *frame, d3d->font_ctx->render_msg(d3d, msg, &font_parms); } - if (!(lifecycle_mode_state & (1ULL << MODE_MENU_DRAW))) - gfx_ctx_xdk_swap_buffers(); + gfx_ctx_xdk_swap_buffers(); return true; }