Optimization suggested by Ryan:
Don't set the same OpenGL context multiple times --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402607
This commit is contained in:
parent
b480be4c28
commit
e8458df2b4
2 changed files with 7 additions and 0 deletions
|
@ -126,6 +126,7 @@ struct SDL_Window
|
|||
|
||||
int display;
|
||||
SDL_Renderer *renderer;
|
||||
SDL_GLContext context;
|
||||
|
||||
void *userdata;
|
||||
void *driverdata;
|
||||
|
|
|
@ -2566,6 +2566,12 @@ SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context)
|
|||
if (!context) {
|
||||
window = NULL;
|
||||
}
|
||||
if (window) {
|
||||
if (window->context == context) {
|
||||
return 0;
|
||||
}
|
||||
window->context = context;
|
||||
}
|
||||
return _this->GL_MakeCurrent(_this, window, context);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue