diff --git a/libobs/obs-internal.h b/libobs/obs-internal.h index 40e3403a3..2be6809d2 100644 --- a/libobs/obs-internal.h +++ b/libobs/obs-internal.h @@ -371,6 +371,8 @@ extern struct obs_core *obs; extern void *obs_video_thread(void *param); +extern gs_effect_t *obs_load_effect(gs_effect_t **effect, const char *file); + extern bool audio_callback(void *param, uint64_t start_ts_in, uint64_t end_ts_in, uint64_t *out_ts, uint32_t mixers, struct audio_output_data *mixes); diff --git a/libobs/obs.c b/libobs/obs.c index 966f2d96f..664176313 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -215,6 +215,17 @@ static bool obs_init_textures(struct obs_video_info *ovi) return true; } +gs_effect_t *obs_load_effect(gs_effect_t **effect, const char *file) +{ + if (!*effect) { + char *filename = find_libobs_data_file(file); + *effect = gs_effect_create_from_file(filename, NULL); + bfree(filename); + } + + return *effect; +} + static int obs_init_graphics(struct obs_video_info *ovi) { struct obs_core_video *video = &obs->video;