(API Change) libobs: Use single func for base effects
API removed: -------------------- gs_effect_t *obs_get_default_effect(void); gs_effect_t *obs_get_default_rect_effect(void); gs_effect_t *obs_get_opaque_effect(void); gs_effect_t *obs_get_solid_effect(void); gs_effect_t *obs_get_bicubic_effect(void); gs_effect_t *obs_get_lanczos_effect(void); gs_effect_t *obs_get_bilinear_lowres_effect(void); API added: -------------------- gs_effect_t *obs_get_base_effect(enum obs_base_effect effect); Summary: -------------------- Combines multiple near-identical functions into a single function with an enum parameter.
This commit is contained in:
@@ -210,38 +210,3 @@ void dc_capture_render(struct dc_capture *capture, gs_effect_t *effect)
|
||||
if (capture->textures_written[last_tex])
|
||||
draw_texture(capture, last_tex, effect);
|
||||
}
|
||||
|
||||
gs_effect_t *create_opaque_effect(void)
|
||||
{
|
||||
gs_effect_t *opaque_effect;
|
||||
char *effect_file;
|
||||
char *error_string = NULL;
|
||||
|
||||
effect_file = obs_module_file("opaque.effect");
|
||||
if (!effect_file) {
|
||||
blog(LOG_ERROR, "[create_opaque_effect] Could not find "
|
||||
"opaque effect file");
|
||||
return false;
|
||||
}
|
||||
|
||||
obs_enter_graphics();
|
||||
|
||||
opaque_effect = gs_effect_create_from_file(effect_file, &error_string);
|
||||
|
||||
if (!opaque_effect) {
|
||||
if (error_string)
|
||||
blog(LOG_ERROR, "[create_opaque_effect] Failed to "
|
||||
"create opaque effect:\n%s",
|
||||
error_string);
|
||||
else
|
||||
blog(LOG_ERROR, "[create_opaque_effect] Failed to "
|
||||
"create opaque effect");
|
||||
}
|
||||
|
||||
bfree(effect_file);
|
||||
bfree(error_string);
|
||||
|
||||
obs_leave_graphics();
|
||||
|
||||
return opaque_effect;
|
||||
}
|
||||
|
Reference in New Issue
Block a user