From c4afb2a154a9739af36dd3cf2b07624f6680bb1b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 22 Mar 2015 07:20:55 +0100 Subject: [PATCH] Create video_driver_has_windowed --- gfx/video_driver.c | 12 ++++++++++++ gfx/video_driver.h | 2 ++ retroarch.c | 6 +----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 6449a3a072..1216def740 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -570,3 +570,15 @@ void init_video(void) &dummy_pixels, false, 1, 1, 1.0f); #endif } + +bool video_driver_has_windowed(void) +{ + driver_t *driver = driver_get_ptr(); + if (!driver->video) + return false; + /* If video driver/context does not support windowed + * mode, don't perform command. */ + if (!driver->video->has_windowed(driver->video_data)) + return false; + return true; +} diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 07013bfd32..0ca7f1cfe2 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -272,6 +272,8 @@ void uninit_video_input(void); void init_video(void); +bool video_driver_has_windowed(void); + #ifdef __cplusplus } #endif diff --git a/retroarch.c b/retroarch.c index 9ca3696635..0c166bfc5a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2830,11 +2830,7 @@ bool rarch_main_command(unsigned cmd) #endif break; case RARCH_CMD_FULLSCREEN_TOGGLE: - if (!driver->video) - return false; - /* If video driver/context does not support windowed - * mode, don't perform command. */ - if (!driver->video->has_windowed(driver->video_data)) + if (!video_driver_has_windowed()) return false; /* If we go fullscreen we drop all drivers and