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