Create video_driver_set_shader

This commit is contained in:
twinaphex 2015-02-10 17:20:02 +01:00
parent 820595379e
commit 6f165b6801
3 changed files with 15 additions and 2 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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");
}