Fixed bug 1342 - SDL_CreateRenderer creates OpenGL ES 2.0 renderer in iPhone 3G using default index (-1)
The uikit code wasn't checking to make sure the context was successfully created.
--- a/src/video/uikit/SDL_uikitopengles.m Sat Jan 07 22:33:58 2012 -0500
+++ b/src/video/uikit/SDL_uikitopengles.m Sat Jan 07 22:34:51 2012 -0500
@@ -115,6 +115,9 @@
depthBits: _this->gl_config.depth_size
stencilBits: _this->gl_config.stencil_size
majorVersion: _this->gl_config.major_version];
+ if (!view) {
+ return NULL;
+ }
data->view = view;
view->viewcontroller = data->viewcontroller;
--- a/src/video/uikit/SDL_uikitopenglview.m Sat Jan 07 22:33:58 2012 -0500
+++ b/src/video/uikit/SDL_uikitopenglview.m Sat Jan 07 22:34:51 2012 -0500
@@ -75,6 +75,7 @@
}
if (!context || ![EAGLContext setCurrentContext:context]) {
[self release];
+ SDL_SetError("OpenGL ES %d not supported", majorVersion);
return nil;
}