Create gfx_ctx_check_window

This commit is contained in:
twinaphex 2015-04-10 06:10:05 +02:00
parent 33e70124a1
commit 7671f3e035
3 changed files with 23 additions and 8 deletions

View File

@ -2464,15 +2464,10 @@ static bool gl_alive(void *data)
{
bool quit = false, resize = false;
gl_t *gl = (gl_t*)data;
runloop_t *runloop = rarch_main_get_ptr();
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
if (!gl)
return false;
ctx->check_window(gl, &quit,
&resize, &gl->win_width, &gl->win_height,
runloop->frames.video.count);
if (!gfx_ctx_check_window(data, &quit,
&resize, &gl->win_width, &gl->win_height))
return false;
if (quit)
gl->quitting = true;

View File

@ -160,6 +160,23 @@ bool gfx_ctx_has_windowed(void *data)
return true;
}
bool gfx_ctx_check_window(void *data, bool *quit, bool *resize,
unsigned *width, unsigned *height)
{
runloop_t *runloop = rarch_main_get_ptr();
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
unsigned frame_count = runloop ?
runloop->frames.video.count : 0;
if (!data)
return false;
ctx->check_window(data, quit, resize, width, height,
frame_count);
return true;
}
/**
* find_gfx_ctx_driver_index:
* @ident : Identifier of resampler driver to find.

View File

@ -221,6 +221,9 @@ void gfx_ctx_show_mouse(void *data, bool state);
bool gfx_ctx_has_windowed(void *data);
bool gfx_ctx_check_window(void *data, bool *quit, bool *resize,
unsigned *width, unsigned *height);
retro_proc_address_t gfx_ctx_get_proc_address(const char *sym);
#ifdef __cplusplus