Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed a bug where bad access would occur if UIKIT_MakeCurrent is pass…
Browse files Browse the repository at this point in the history
…ed NULL for the parameter 'SDL_GLContext context'. Instead, it clears the current context.
  • Loading branch information
Holmes Futrell committed Aug 13, 2008
1 parent bd9a055 commit 8daef59
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/video/uikit/SDL_uikitopengles.m
Expand Up @@ -41,12 +41,20 @@
return SDL_LoadFunction(RTLD_DEFAULT, proc);
}

/*
note that SDL_GL_Delete context makes it current without passing the window
*/
int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
{

SDL_WindowData *data = (SDL_WindowData *)window->driverdata;

[data->view setCurrentContext];
if (context) {
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
[data->view setCurrentContext];
}
else {
[EAGLContext setCurrentContext: nil];
}

return 0;
}

Expand Down

0 comments on commit 8daef59

Please sign in to comment.