Mercurial > sdl-ios-xcode
comparison src/video/windib/SDL_dibvideo.c @ 442:b37ce4813ad4
Flush message queue when shutting down video mode on Windows
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 17 Aug 2002 19:17:18 +0000 |
parents | a5f60a847a89 |
children | 323c766f5a46 |
comparison
equal
deleted
inserted
replaced
441:598b25b9bffe | 442:b37ce4813ad4 |
---|---|
887 ReleaseDC(SDL_Window, hdc); | 887 ReleaseDC(SDL_Window, hdc); |
888 return succeeded ? 0 : -1; | 888 return succeeded ? 0 : -1; |
889 #endif /* !NO_GAMMA_SUPPORT */ | 889 #endif /* !NO_GAMMA_SUPPORT */ |
890 } | 890 } |
891 | 891 |
892 static void FlushMessageQueue() | |
893 { | |
894 MSG msg; | |
895 while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) { | |
896 if ( msg.message == WM_QUIT ) break; | |
897 TranslateMessage( &msg ); | |
898 DispatchMessage( &msg ); | |
899 } | |
900 } | |
901 | |
892 void DIB_VideoQuit(_THIS) | 902 void DIB_VideoQuit(_THIS) |
893 { | 903 { |
894 /* Destroy the window and everything associated with it */ | 904 /* Destroy the window and everything associated with it */ |
895 if ( SDL_Window ) { | 905 if ( SDL_Window ) { |
896 /* Delete the screen bitmap (also frees screen->pixels) */ | 906 /* Delete the screen bitmap (also frees screen->pixels) */ |
916 DestroyIcon(screen_icn); | 926 DestroyIcon(screen_icn); |
917 screen_icn = NULL; | 927 screen_icn = NULL; |
918 } | 928 } |
919 DIB_QuitGamma(this); | 929 DIB_QuitGamma(this); |
920 DIB_DestroyWindow(this); | 930 DIB_DestroyWindow(this); |
931 FlushMessageQueue(); | |
921 | 932 |
922 SDL_Window = NULL; | 933 SDL_Window = NULL; |
923 } | 934 } |
924 } | 935 } |
925 | 936 |