Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Optimization suggested by Ryan:

Don't set the same OpenGL context multiple times
  • Loading branch information
slouken committed Aug 15, 2007
1 parent eb6619e commit e9f192a454935bf53eeb342d224098bcfe4702dd
Showing with 7 additions and 0 deletions.
  1. +1 −0 src/video/SDL_sysvideo.h
  2. +6 −0 src/video/SDL_video.c
@@ -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);
}

0 comments on commit e9f192a

Please sign in to comment.