From 4a46a8c5d71a69b6b1d82cd1238328856a2668d0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 22 Mar 2015 10:25:51 +0100 Subject: [PATCH] Create video_driver_set_nonblock_state --- gfx/video_driver.c | 11 +++++++++++ gfx/video_driver.h | 2 ++ retroarch.c | 3 +-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 0dcdc61fe9..fc47960a31 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -584,3 +584,14 @@ bool video_driver_has_windowed(void) return false; return true; } + +void video_driver_set_nonblock_state(bool toggle) +{ + driver_t *driver = driver_get_ptr(); + + if (!driver->video) + return; + + if (driver->video->set_nonblock_state) + driver->video->set_nonblock_state(driver->video_data, toggle); +} diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 0ca7f1cfe2..4bb8861f26 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -274,6 +274,8 @@ void init_video(void); bool video_driver_has_windowed(void); +void video_driver_set_nonblock_state(bool toggle); + #ifdef __cplusplus } #endif diff --git a/retroarch.c b/retroarch.c index 561a518c50..168eb8097b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2617,8 +2617,7 @@ bool rarch_main_command(unsigned cmd) case RARCH_CMD_VIDEO_SET_NONBLOCKING_STATE: boolean = true; /* fall-through */ case RARCH_CMD_VIDEO_SET_BLOCKING_STATE: - if (driver->video && driver->video->set_nonblock_state) - driver->video->set_nonblock_state(driver->video_data, boolean); + video_driver_set_nonblock_state(boolean); break; case RARCH_CMD_VIDEO_SET_ASPECT_RATIO: if (driver->video_data && driver->video_poke