Mercurial > sdl-ios-xcode
diff src/video/wincommon/SDL_wingl.c @ 1523:21b1fbb53f4a
(patch tweaked a bit)
Date: Tue, 14 Mar 2006 03:30:11 +0000
From: Peter Mulholland
Subject: [SDL] Windows MessageBox() strangeness fixes
Hello all,
I *think* this should fix the issues that people were seeing with
MessageBox() not working and therefore assert() on mingw/msvc. Forgive
me if i've screwed up making the diff file - I'm a total newb when it
comes to things like CVS and diff.
It modifies a few files as I saw that FlushMessageQueue() was in both
the windx5 and windib driver, so I moved this into wincommon. It was
also in the gapi driver, so I changed that too. The function is now
WIN_FlushMessageQueue() in src/video/wincommon/SDL_syswm.c
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 14 Mar 2006 04:00:03 +0000 |
parents | 0a2bd6507477 |
children | ce84e28c2c07 |
line wrap: on
line diff
--- a/src/video/wincommon/SDL_wingl.c Tue Mar 14 03:04:50 2006 +0000 +++ b/src/video/wincommon/SDL_wingl.c Tue Mar 14 04:00:03 2006 +0000 @@ -48,12 +48,16 @@ style = GetWindowLong(SDL_Window, GWL_STYLE); GetWindowRect(SDL_Window, &rect); DestroyWindow(SDL_Window); + WIN_FlushMessageQueue(); + SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, style, rect.left, rect.top, (rect.right-rect.left)+1, (rect.top-rect.bottom)+1, NULL, NULL, SDL_Instance, NULL); + WIN_FlushMessageQueue(); + if ( SDL_Window ) { this->SetCaption(this, this->wm_title, this->wm_icon); } else { @@ -118,6 +122,8 @@ hwnd = CreateWindow(SDL_Appname, SDL_Appname, WS_POPUP | WS_DISABLED, 0, 0, 10, 10, NULL, NULL, SDL_Instance, NULL); + WIN_FlushMessageQueue(); + hdc = GetDC(hwnd); pformat = ChoosePixelFormat(hdc, &GL_pfd); @@ -158,6 +164,7 @@ } ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); + WIN_FlushMessageQueue(); } #endif /* SDL_VIDEO_OPENGL */