comparison src/video/windx5/SDL_dx5video.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 791d5ce383bc
children 778b970cec12
comparison
equal deleted inserted replaced
441:598b25b9bffe 442:b37ce4813ad4
2203 IDirectDrawGammaControl_Release(gamma); 2203 IDirectDrawGammaControl_Release(gamma);
2204 return (result == DD_OK) ? 0 : -1; 2204 return (result == DD_OK) ? 0 : -1;
2205 #endif /* !IDirectDrawGammaControl_SetGammaRamp */ 2205 #endif /* !IDirectDrawGammaControl_SetGammaRamp */
2206 } 2206 }
2207 2207
2208 static void FlushMessageQueue()
2209 {
2210 MSG msg;
2211 while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) {
2212 if ( msg.message == WM_QUIT ) break;
2213 TranslateMessage( &msg );
2214 DispatchMessage( &msg );
2215 }
2216 }
2217
2208 void DX5_VideoQuit(_THIS) 2218 void DX5_VideoQuit(_THIS)
2209 { 2219 {
2210 int i, j; 2220 int i, j;
2211 2221
2212 /* If we're fullscreen GL, we need to reset the display */ 2222 /* If we're fullscreen GL, we need to reset the display */
2244 2254
2245 /* Free the window */ 2255 /* Free the window */
2246 DIB_QuitGamma(this); 2256 DIB_QuitGamma(this);
2247 if ( SDL_Window ) { 2257 if ( SDL_Window ) {
2248 DX5_DestroyWindow(this); 2258 DX5_DestroyWindow(this);
2259 FlushMessageQueue();
2249 } 2260 }
2250 2261
2251 /* Free our window icon */ 2262 /* Free our window icon */
2252 if ( screen_icn ) { 2263 if ( screen_icn ) {
2253 DestroyIcon(screen_icn); 2264 DestroyIcon(screen_icn);