mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-05 15:16:13 -05:00
(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:
@@ -491,7 +491,7 @@ void OBSBasic::InitOBSCallbacks()
|
||||
|
||||
void OBSBasic::InitPrimitives()
|
||||
{
|
||||
gs_entercontext(obs_graphics());
|
||||
obs_enter_graphics();
|
||||
|
||||
gs_renderstart(true);
|
||||
gs_vertex2f(0.0f, 0.0f);
|
||||
@@ -508,7 +508,7 @@ void OBSBasic::InitPrimitives()
|
||||
}
|
||||
circle = gs_rendersave();
|
||||
|
||||
gs_leavecontext();
|
||||
obs_leave_graphics();
|
||||
}
|
||||
|
||||
void OBSBasic::OBSInit()
|
||||
@@ -588,10 +588,10 @@ OBSBasic::~OBSBasic()
|
||||
ui->sources->clear();
|
||||
ui->scenes->clear();
|
||||
|
||||
gs_entercontext(obs_graphics());
|
||||
obs_enter_graphics();
|
||||
vertexbuffer_destroy(box);
|
||||
vertexbuffer_destroy(circle);
|
||||
gs_leavecontext();
|
||||
obs_leave_graphics();
|
||||
|
||||
obs_shutdown();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user