mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
(RMenu) Run glClear or equivalent function at start of driver_frame function
so that we can use rarch_render_cached_frame for menu purposes at all times (instead of doing explicit clearing in our menu loops beforehand for low-RAM modes where no menu texture is being drawn but we don't want ghosting in the picture)
This commit is contained in:
parent
1171b7576a
commit
8c777110f7
@ -3423,32 +3423,22 @@ bool menu_iterate(void)
|
||||
|
||||
g_extern.frame_count++;
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE)))
|
||||
if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE)))
|
||||
{
|
||||
#if defined(HAVE_OPENGL)
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
#elif defined(HAVE_D3D8) || defined(HAVE_D3D9)
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->d3d_render_device;
|
||||
d3dr->Clear(0, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// draw last frame for loading messages
|
||||
if (driver.video_poke && driver.video_poke->set_texture_enable)
|
||||
{
|
||||
driver.video_poke->set_texture_frame(driver.video_data, menu_texture->pixels,
|
||||
true, menu_texture->width, menu_texture->height, 1.0f);
|
||||
driver.video_poke->set_texture_enable(driver.video_data, true);
|
||||
}
|
||||
|
||||
rarch_render_cached_frame();
|
||||
|
||||
if (driver.video_poke && driver.video_poke->set_texture_enable)
|
||||
driver.video_poke->set_texture_enable(driver.video_data, false);
|
||||
}
|
||||
|
||||
// draw last frame for loading messages
|
||||
rarch_render_cached_frame();
|
||||
|
||||
if (driver.video_poke && driver.video_poke->set_texture_enable)
|
||||
driver.video_poke->set_texture_enable(driver.video_data, false);
|
||||
|
||||
//first button input frame
|
||||
uint64_t input_state_first_frame = 0;
|
||||
uint64_t input_state = 0;
|
||||
|
7
gfx/gl.c
7
gfx/gl.c
@ -1339,6 +1339,13 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
|
||||
uint64_t lifecycle_mode_state = g_extern.lifecycle_mode_state;
|
||||
(void)lifecycle_mode_state;
|
||||
|
||||
#ifdef __CELLOS_LV2__
|
||||
/* FIXME - check if it makes sense for all other platforms to do a glClear
|
||||
* at start of gl_frame as well - if so, we can drop this ifdef and make
|
||||
* it implicit */
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
#endif
|
||||
|
||||
gl_shader_use_func(gl, 1);
|
||||
|
||||
#ifdef IOS // Apparently the viewport is lost each frame, thanks apple.
|
||||
|
Loading…
Reference in New Issue
Block a user