Skip to content
Permalink
Browse files

Mac OS X: Try to save the GL context when toggling windowed and fulls…

…creen.
  • Loading branch information
icculus committed Nov 4, 2011
1 parent dc977f8 commit 7e476e94ad2e7a83413540f6e2ee7942f93c5559
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/video/quartz/SDL_QuartzVideo.m
@@ -1115,7 +1115,7 @@ other blitting while waiting on the VBL (and hence results in higher framerates)
const BOOL isLion = IS_LION_OR_LATER(this);

/* Don't throw away the GL context if we can just resize the current one. */
if ( (video_set == SDL_TRUE) && ((flags & (SDL_OPENGL | SDL_FULLSCREEN)) == (current->flags & (SDL_OPENGL | SDL_FULLSCREEN))) && (bpp == current->format->BitsPerPixel) ) {
if ( (video_set == SDL_TRUE) && ((flags & SDL_OPENGL) == (current->flags & SDL_OPENGL)) && (bpp == current->format->BitsPerPixel) ) {
const NSRect contentRect = NSMakeRect (0, 0, width, height);
if (flags & SDL_FULLSCREEN) {
/* if these fail, we'll try the old way, of tearing everything down. */
@@ -1135,6 +1135,9 @@ other blitting while waiting on the VBL (and hence results in higher framerates)
}
}
} else {
QZ_RestoreDisplayMode(this);
QZ_ReleaseDisplayMode(this, mode); /* NULL is okay. */
mode = NULL;
current->w = width;
current->h = height;
[ qz_window setContentSize:contentRect.size ];

0 comments on commit 7e476e9

Please sign in to comment.