From 6f165b6801575f4c783b5e4b6cb36add27f19d02 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 10 Feb 2015 17:20:02 +0100 Subject: [PATCH] Create video_driver_set_shader --- gfx/video_driver.c | 10 ++++++++++ gfx/video_driver.h | 3 +++ runloop.c | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 5a0f15622b..2e8b287a38 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -252,6 +252,16 @@ bool video_driver_has_focus(void) return true; } +bool video_driver_set_shader(enum rarch_shader_type type, + const char *shader) +{ + if (!driver.video || !driver.video_data) + return false; + if (!driver.video->set_shader(driver.video_data, type, shader)) + return false; + return true; +} + static void deinit_video_filter(void) { rarch_softfilter_free(g_extern.filter.filter); diff --git a/gfx/video_driver.h b/gfx/video_driver.h index bb754d9502..dfacbc979c 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -248,6 +248,9 @@ bool video_driver_is_alive(void); bool video_driver_has_focus(void); +bool video_driver_set_shader(enum rarch_shader_type type, + const char *shader); + void uninit_video_input(void); void init_video(void); diff --git a/runloop.c b/runloop.c index 33cb4c30e9..acfd531e6c 100644 --- a/runloop.c +++ b/runloop.c @@ -417,7 +417,7 @@ static void check_shader_dir(bool pressed_next, bool pressed_prev) const char *shader = NULL, *ext = NULL; enum rarch_shader_type type = RARCH_SHADER_NONE; - if (!g_extern.shader_dir.list || !driver.video->set_shader) + if (!g_extern.shader_dir.list) return; if (pressed_next) @@ -452,7 +452,7 @@ static void check_shader_dir(bool pressed_next, bool pressed_prev) msg_queue_push(g_extern.msg_queue, msg, 1, 120); RARCH_LOG("Applying shader \"%s\".\n", shader); - if (!driver.video->set_shader(driver.video_data, type, shader)) + if (!video_driver_set_shader(type, shader)) RARCH_WARN("Failed to apply shader.\n"); }