src/video/uikit/SDL_uikitopengles.m
changeset 7423 dfe7ad02f008
parent 7285 bcfd0bcaf4f3
child 7424 1644ff584b17
--- a/src/video/uikit/SDL_uikitopengles.m	Fri Jul 12 10:44:55 2013 -0700
+++ b/src/video/uikit/SDL_uikitopengles.m	Fri Jul 12 23:30:26 2013 -0400
@@ -104,6 +104,11 @@
     SDL_DisplayData *displaydata = display->driverdata;
     SDL_DisplayModeData *displaymodedata = display->current_mode.driverdata;
     UIWindow *uiwindow = data->uiwindow;
+    EAGLSharegroup *share_group = nil;
+
+    if (_this->gl_config.share_with_current_context) {
+        share_group = [((SDL_uikitopenglview *) SDL_GL_GetCurrentContext() sharegroup];
+    }
 
     /* construct our view, passing in SDL's OpenGL configuration data */
     CGRect frame;
@@ -121,7 +126,8 @@
                                     aBits: _this->gl_config.alpha_size
                                     depthBits: _this->gl_config.depth_size
                                     stencilBits: _this->gl_config.stencil_size
-                                    majorVersion: _this->gl_config.major_version];
+                                    majorVersion: _this->gl_config.major_version
+                                    shareGroup: share_group];
     if (!view) {
         return NULL;
     }