changeset 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 d94e331e85fa
children e7eec78e4b92
files src/video/SDL_video.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
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);
             }