From 37a5a7e653e68eed2382706ffd47aee8c2c94653 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 10 Apr 2015 06:13:20 +0200 Subject: [PATCH] Create gfx_ctx_suppress_screensaver --- gfx/drivers/gl.c | 7 +------ gfx/video_context_driver.c | 9 +++++++++ gfx/video_context_driver.h | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index aefc29df6e..4d405942ce 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -2484,12 +2484,7 @@ static bool gl_focus(void *data) static bool gl_suppress_screensaver(void *data, bool enable) { - gl_t *gl = (gl_t*)data; - const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); - - if (gl && ctx) - return ctx->suppress_screensaver(gl, enable); - return false; + return gfx_ctx_suppress_screensaver(data, enable); } static bool gl_has_windowed(void *data) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index d6e113ec69..f371f53ec6 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -177,6 +177,15 @@ bool gfx_ctx_check_window(void *data, bool *quit, bool *resize, return true; } +bool gfx_ctx_suppress_screensaver(void *data, bool enable) +{ + const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); + + if (data && ctx) + return ctx->suppress_screensaver(data, enable); + return false; +} + /** * find_gfx_ctx_driver_index: * @ident : Identifier of resampler driver to find. diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index f0956f2a64..5cbea35457 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -224,6 +224,8 @@ bool gfx_ctx_has_windowed(void *data); bool gfx_ctx_check_window(void *data, bool *quit, bool *resize, unsigned *width, unsigned *height); +bool gfx_ctx_suppress_screensaver(void *data, bool enable); + retro_proc_address_t gfx_ctx_get_proc_address(const char *sym); #ifdef __cplusplus