comparison 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
comparison
equal deleted inserted replaced
3515:d94e331e85fa 3516:72e70a8c30d5
1491 1491
1492 if (!_this) { 1492 if (!_this) {
1493 return; 1493 return;
1494 } 1494 }
1495 1495
1496 /* Restore video mode, etc. */
1497 SDL_SetWindowFullscreen(windowID, 0);
1498
1499 for (i = 0; i < _this->num_displays; ++i) { 1496 for (i = 0; i < _this->num_displays; ++i) {
1500 SDL_VideoDisplay *display = &_this->displays[i]; 1497 SDL_VideoDisplay *display = &_this->displays[i];
1501 for (j = 0; j < display->num_windows; ++j) { 1498 for (j = 0; j < display->num_windows; ++j) {
1502 SDL_Window *window = &display->windows[j]; 1499 SDL_Window *window = &display->windows[j];
1503 if (window->id != windowID) { 1500 if (window->id != windowID) {
1509 } 1506 }
1510 if (window->renderer) { 1507 if (window->renderer) {
1511 SDL_DestroyRenderer(window->id); 1508 SDL_DestroyRenderer(window->id);
1512 window->renderer = NULL; 1509 window->renderer = NULL;
1513 } 1510 }
1511
1512 /* Restore video mode, etc. */
1513 SDL_UpdateFullscreenMode(window, SDL_FALSE);
1514
1514 if (_this->DestroyWindow) { 1515 if (_this->DestroyWindow) {
1515 _this->DestroyWindow(_this, window); 1516 _this->DestroyWindow(_this, window);
1516 } 1517 }
1517 if (window->flags & SDL_WINDOW_OPENGL) { 1518 if (window->flags & SDL_WINDOW_OPENGL) {
1518 SDL_GL_UnloadLibrary(); 1519 SDL_GL_UnloadLibrary();