(PS3) Implement gfx_ctx_swap_buffers

This commit is contained in:
Twinaphex 2012-05-27 16:23:01 +02:00
parent 3dbc1a3e7f
commit d72751956e
4 changed files with 35 additions and 23 deletions

View File

@ -60,3 +60,7 @@ bool gfx_ctx_window_has_focus(void)
return true;
}
void gfx_ctx_swap_buffers(void)
{
psglSwap();
}

View File

@ -126,6 +126,9 @@ struct gl_tex_info
typedef struct gl
{
#ifdef RARCH_CONSOLE
bool block_swap;
#endif
bool vsync;
GLuint texture[TEXTURES];
unsigned tex_index; // For use with PREV.

View File

@ -1105,8 +1105,10 @@ static void rarch_filename_input_and_save (unsigned filename_type)
{
glClear(GL_COLOR_BUFFER_BIT);
gl_frame_menu();
video_gl.swap(NULL);
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
}
if(g_console.oskutil_handle.text_can_be_fetched)
@ -1138,8 +1140,10 @@ static void rarch_filename_input_and_save (unsigned filename_type)
{
/* OSK Util gets updated */
glClear(GL_COLOR_BUFFER_BIT);
video_gl.swap(NULL);
cellSysutilCheckCallback();
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
}
if(g_console.oskutil_handle.text_can_be_fetched)
@ -1545,8 +1549,10 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
while(OSK_IS_RUNNING(g_console.oskutil_handle))
{
glClear(GL_COLOR_BUFFER_BIT);
video_gl.swap(NULL);
cellSysutilCheckCallback();
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
}
if(g_console.oskutil_handle.text_can_be_fetched)
@ -2353,7 +2359,10 @@ static void ingame_menu(uint32_t menu_id)
cellDbgFontPrintf (0.09f, 0.83f, 0.91f, LIGHTBLUE, "Allows you to resize the screen by moving around the two analog sticks.\nPress TRIANGLE to reset to default values, and CIRCLE to go back to the menu.");
cellDbgFontDraw();
}
video_gl.swap(NULL);
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
if(CTRL_SQUARE(~state))
{
glDisable(GL_BLEND);
@ -2376,7 +2385,10 @@ static void ingame_menu(uint32_t menu_id)
rarch_render_cached_frame();
video_gl.swap(NULL);
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
}
}
@ -2642,7 +2654,10 @@ void menu_loop(void)
SET_TIMER_EXPIRATION(g_console.timer_expiration_frame_count, 30);
}
video_gl.swap(NULL);
gfx_ctx_swap_buffers();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
glDisable(GL_BLEND);
}while (g_console.menu_enable);

View File

@ -100,7 +100,6 @@ static const GLfloat white_color[] = {
};
struct {
bool block_swap;
bool overscan_enable;
GLfloat overscan_amount;
#ifdef HAVE_CG_MENU
@ -954,8 +953,8 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
gl_render_msg_post(gl);
}
if(!ps3_gl.block_swap)
psglSwap();
if(!gl->block_swap)
gfx_ctx_swap_buffers();
return true;
}
@ -1202,19 +1201,11 @@ static bool gl_focus(void *data)
return gfx_ctx_window_has_focus();
}
static void ps3graphics_set_swap_block_swap(void * data, bool toggle)
static void ps3graphics_set_swap_block_swap(void * data, bool enable)
{
(void)data;
ps3_gl.block_swap = toggle;
}
gl_t *gl = driver.video_data;
static void ps3graphics_swap(void * data)
{
(void)data;
psglSwap();
#ifdef HAVE_SYSUTILS
cellSysutilCheckCallback();
#endif
gl->block_swap = enable;
}
static void ps3graphics_set_aspect_ratio(void * data, uint32_t aspectratio_index)
@ -1245,7 +1236,6 @@ const video_driver_t video_gl =
.set_swap_block_state = ps3graphics_set_swap_block_swap,
.set_rotation = ps3graphics_set_orientation,
.set_aspect_ratio = ps3graphics_set_aspect_ratio,
.swap = ps3graphics_swap
};
static void get_all_available_resolutions (void)