comparison src/video/uikit/SDL_uikitopengles.m @ 2416:d92493ff1b51 gsoc2008_iphone

Fixed a bug where bad access would occur if UIKIT_MakeCurrent is passed NULL for the parameter 'SDL_GLContext context'. Instead, it clears the current context.
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Wed, 13 Aug 2008 20:56:21 +0000
parents e9a1eed243c9
children bf7028ffbf07
comparison
equal deleted inserted replaced
2415:93fd226af6d0 2416:d92493ff1b51
39 -We don't know that the path won't change in the future. 39 -We don't know that the path won't change in the future.
40 */ 40 */
41 return SDL_LoadFunction(RTLD_DEFAULT, proc); 41 return SDL_LoadFunction(RTLD_DEFAULT, proc);
42 } 42 }
43 43
44 /*
45 note that SDL_GL_Delete context makes it current without passing the window
46 */
44 int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) 47 int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
45 { 48 {
46 49
47 SDL_WindowData *data = (SDL_WindowData *)window->driverdata; 50 if (context) {
48 51 SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
49 [data->view setCurrentContext]; 52 [data->view setCurrentContext];
53 }
54 else {
55 [EAGLContext setCurrentContext: nil];
56 }
57
50 return 0; 58 return 0;
51 } 59 }
52 60
53 int 61 int
54 UIKit_GL_LoadLibrary(_THIS, const char *path) 62 UIKit_GL_LoadLibrary(_THIS, const char *path)