diff src/video/SDL_video.c @ 3516:72e70a8c30d5

Restore the video mode after shutting down the renderer, which fixes an error deleting the OpenGL context on Mac OS X.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 03 Dec 2009 05:05:26 +0000
parents 5ffbbfb78987
children e7eec78e4b92
line wrap: on
line diff
--- a/src/video/SDL_video.c	Thu Dec 03 04:33:05 2009 +0000
+++ b/src/video/SDL_video.c	Thu Dec 03 05:05:26 2009 +0000
@@ -1493,9 +1493,6 @@
         return;
     }
 
-    /* Restore video mode, etc. */
-    SDL_SetWindowFullscreen(windowID, 0);
-
     for (i = 0; i < _this->num_displays; ++i) {
         SDL_VideoDisplay *display = &_this->displays[i];
         for (j = 0; j < display->num_windows; ++j) {
@@ -1511,6 +1508,10 @@
                 SDL_DestroyRenderer(window->id);
                 window->renderer = NULL;
             }
+
+            /* Restore video mode, etc. */
+            SDL_UpdateFullscreenMode(window, SDL_FALSE);
+
             if (_this->DestroyWindow) {
                 _this->DestroyWindow(_this, window);
             }