# HG changeset patch # User Sam Lantinga # Date 1187149951 0 # Node ID 989fb86ad1ec799dbbfa36a40309f32f409d3bcd # Parent 5234868559faae5466468ab40e980d3e0316fa05 Optimization suggested by Ryan: Don't set the same OpenGL context multiple times diff -r 5234868559fa -r 989fb86ad1ec src/video/SDL_sysvideo.h --- a/src/video/SDL_sysvideo.h Wed Aug 15 03:50:49 2007 +0000 +++ b/src/video/SDL_sysvideo.h Wed Aug 15 03:52:31 2007 +0000 @@ -126,6 +126,7 @@ int display; SDL_Renderer *renderer; + SDL_GLContext context; void *userdata; void *driverdata; diff -r 5234868559fa -r 989fb86ad1ec src/video/SDL_video.c --- a/src/video/SDL_video.c Wed Aug 15 03:50:49 2007 +0000 +++ b/src/video/SDL_video.c Wed Aug 15 03:52:31 2007 +0000 @@ -2566,6 +2566,12 @@ if (!context) { window = NULL; } + if (window) { + if (window->context == context) { + return 0; + } + window->context = context; + } return _this->GL_MakeCurrent(_this, window, context); }