Fixed fullscreen modes with Cocoa video driver.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402020
This commit is contained in:
Sam Lantinga 2006-08-06 08:55:37 +00:00
parent 296ed89309
commit 1c97a53526
3 changed files with 59 additions and 8 deletions

View file

@ -247,11 +247,6 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
/* End Wisdom from Apple Engineer section. --ryan. */
/* FIXME: should this go somewhere else? */
if (window->flags & SDL_WINDOW_FULLSCREEN) {
[nscontext setFullScreen];
}
[pool release];
return nscontext;
}
@ -267,8 +262,12 @@ Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata;
NSOpenGLContext *nscontext = (NSOpenGLContext *)context;
[nscontext setView:[windowdata->window contentView]];
[nscontext update];
if (window->flags & SDL_WINDOW_FULLSCREEN) {
[nscontext setFullScreen];
} else {
[nscontext setView:[windowdata->window contentView]];
[nscontext update];
}
[nscontext makeCurrentContext];
} else {
[NSOpenGLContext clearCurrentContext];