(API Change) Remove obs_graphics()

API Removed:
- graphics_t obs_graphics();
Replaced With:
- void obs_enter_graphics();
- void obs_leave_graphics();

Description:
  obs_graphics() was somewhat of a pointless function.  The only time
that it was ever necessary was to pass it as a parameter to
gs_entercontext() followed by a subsequent gs_leavecontext() call after
that.  So, I felt that it made a bit more sense just to implement
obs_enter_graphics() and obs_leave_graphics() functions to do the exact
same thing without having to repeat that code.  There's really no need
to ever "hold" the graphics pointer, though I suppose that could change
in the future so having a similar function come back isn't out of the
question.

Still, this at least reduces the amount of unnecessary repeated code for
the time being.
This commit is contained in:
jp9000
2014-08-04 05:48:58 -07:00
parent b007c6b139
commit 41176eef27
14 changed files with 66 additions and 56 deletions

View File

@@ -15,12 +15,12 @@ static void filter_destroy(void *data)
struct test_filter *tf = data;
if (tf) {
gs_entercontext(obs_graphics());
obs_enter_graphics();
effect_destroy(tf->whatever);
bfree(tf);
gs_leavecontext();
obs_leave_graphics();
}
}
@@ -29,7 +29,7 @@ static void *filter_create(obs_data_t settings, obs_source_t source)
struct test_filter *tf = bzalloc(sizeof(struct test_filter));
char *effect_file;
gs_entercontext(obs_graphics());
obs_enter_graphics();
effect_file = obs_module_file("test.effect");
@@ -41,7 +41,7 @@ static void *filter_create(obs_data_t settings, obs_source_t source)
return NULL;
}
gs_leavecontext();
obs_leave_graphics();
UNUSED_PARAMETER(settings);
return tf;