diff src/video/uikit/SDL_uikitopengles.m @ 4446:8b03a20b320f

Much improved multi-display support for iPad. Fixes most issues and limitations, I think.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 02 May 2010 05:08:12 -0400
parents 42e1092225f9
children 6dc6a2bdd55e
line wrap: on
line diff
--- a/src/video/uikit/SDL_uikitopengles.m	Sat May 01 13:50:56 2010 -0400
+++ b/src/video/uikit/SDL_uikitopengles.m	Sun May 02 05:08:12 2010 -0400
@@ -99,13 +99,13 @@
 
 SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)
 {
-	
 	SDL_uikitopenglview *view;
+	SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+    UIScreen *uiscreen = (UIScreen *) window->display->driverdata;
+	UIWindow *uiwindow = data->uiwindow;
 
-	SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
-	
-	/* construct our view, passing in SDL's OpenGL configuration data */
-	view = [[SDL_uikitopenglview alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame] \
+    /* construct our view, passing in SDL's OpenGL configuration data */
+    view = [[SDL_uikitopenglview alloc] initWithFrame: [uiwindow bounds] \
 									retainBacking: _this->gl_config.retained_backing \
 									rBits: _this->gl_config.red_size \
 									gBits: _this->gl_config.green_size \
@@ -116,7 +116,7 @@
 	data->view = view;
 	
 	/* add the view to our window */
-	[data->uiwindow addSubview: view ];
+	[uiwindow addSubview: view ];
 	
 	/* Don't worry, the window retained the view */
 	[view release];