Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
4445:06becafcac89 | 4446:8b03a20b320f |
---|---|
97 | 97 |
98 } | 98 } |
99 | 99 |
100 SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) | 100 SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) |
101 { | 101 { |
102 | |
103 SDL_uikitopenglview *view; | 102 SDL_uikitopenglview *view; |
103 SDL_WindowData *data = (SDL_WindowData *) window->driverdata; | |
104 UIScreen *uiscreen = (UIScreen *) window->display->driverdata; | |
105 UIWindow *uiwindow = data->uiwindow; | |
104 | 106 |
105 SDL_WindowData *data = (SDL_WindowData *)window->driverdata; | 107 /* construct our view, passing in SDL's OpenGL configuration data */ |
106 | 108 view = [[SDL_uikitopenglview alloc] initWithFrame: [uiwindow bounds] \ |
107 /* construct our view, passing in SDL's OpenGL configuration data */ | |
108 view = [[SDL_uikitopenglview alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame] \ | |
109 retainBacking: _this->gl_config.retained_backing \ | 109 retainBacking: _this->gl_config.retained_backing \ |
110 rBits: _this->gl_config.red_size \ | 110 rBits: _this->gl_config.red_size \ |
111 gBits: _this->gl_config.green_size \ | 111 gBits: _this->gl_config.green_size \ |
112 bBits: _this->gl_config.blue_size \ | 112 bBits: _this->gl_config.blue_size \ |
113 aBits: _this->gl_config.alpha_size \ | 113 aBits: _this->gl_config.alpha_size \ |
114 depthBits: _this->gl_config.depth_size]; | 114 depthBits: _this->gl_config.depth_size]; |
115 | 115 |
116 data->view = view; | 116 data->view = view; |
117 | 117 |
118 /* add the view to our window */ | 118 /* add the view to our window */ |
119 [data->uiwindow addSubview: view ]; | 119 [uiwindow addSubview: view ]; |
120 | 120 |
121 /* Don't worry, the window retained the view */ | 121 /* Don't worry, the window retained the view */ |
122 [view release]; | 122 [view release]; |
123 | 123 |
124 if ( UIKit_GL_MakeCurrent(_this, window, view) < 0 ) { | 124 if ( UIKit_GL_MakeCurrent(_this, window, view) < 0 ) { |