void DIB_VideoQuit(_THIS) { /* Destroy the window and everything associated with it */ if ( SDL_Window ) { /* Delete the screen bitmap (also frees screen->pixels) */ if ( this->screen ) { #ifdef WIN32_PLATFORM_PSPC if ( this->screen->flags & SDL_FULLSCREEN ) { /* Unhide taskbar, etc. */ SHFullScreen(SDL_Window, SHFS_SHOWTASKBAR); SHFullScreen(SDL_Window, SHFS_SHOWSIPBUTTON); ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOWNORMAL); } #endif #ifndef NO_CHANGEDISPLAYSETTINGS if ( this->screen->flags & SDL_FULLSCREEN ) { ChangeDisplaySettings(NULL, 0); ShowWindow(SDL_Window, SW_HIDE); } #endif #ifdef HAVE_OPENGL //maks if ( this->screen->flags & SDL_OPENGL ) { WIN_GL_ShutDown(this); } #endif this->screen->pixels = NULL; } if ( screen_bmp ) { DeleteObject(screen_bmp); screen_bmp = NULL; } if ( screen_icn ) { DestroyIcon(screen_icn); screen_icn = NULL; } DIB_QuitGamma(this); DIB_DestroyWindow(this); FlushMessageQueue(); SDL_Window = NULL; } }
void DIB_VideoQuit(_THIS) { int i, j; /* Destroy the window and everything associated with it */ if ( SDL_Window ) { /* Delete the screen bitmap (also frees screen->pixels) */ if ( this->screen ) { if ( grab_palette ) { DIB_ReleaseStaticColors(SDL_Window); } #ifndef NO_CHANGEDISPLAYSETTINGS if ( this->screen->flags & SDL_FULLSCREEN ) { ChangeDisplaySettings(NULL, 0); ShowWindow(SDL_Window, SW_HIDE); } #endif if ( this->screen->flags & SDL_OPENGL ) { WIN_GL_ShutDown(this); } this->screen->pixels = NULL; } if ( screen_pal != NULL ) { DeleteObject(screen_pal); screen_pal = NULL; } if ( screen_logpal != NULL ) { SDL_free(screen_logpal); screen_logpal = NULL; } if ( screen_bmp ) { DeleteObject(screen_bmp); screen_bmp = NULL; } if ( screen_icn ) { DestroyIcon(screen_icn); screen_icn = NULL; } DIB_QuitGamma(this); DIB_DestroyWindow(this); SDL_Window = NULL; #if defined(_WIN32_WCE) // Unload wince aygshell library to prevent leak if( aygshell ) { FreeLibrary(aygshell); aygshell = NULL; } #endif } for ( i=0; i < SDL_arraysize(SDL_modelist); ++i ) { if ( !SDL_modelist[i] ) { continue; } for ( j=0; SDL_modelist[i][j]; ++j ) { SDL_free(SDL_modelist[i][j]); } SDL_free(SDL_modelist[i]); SDL_modelist[i] = NULL; SDL_nummodes[i] = 0; } }