comparison 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
comparison
equal deleted inserted replaced
1522:1078552c83a0 1523:21b1fbb53f4a
46 LONG style; 46 LONG style;
47 RECT rect = { 0, 0, 0, 0 }; 47 RECT rect = { 0, 0, 0, 0 };
48 style = GetWindowLong(SDL_Window, GWL_STYLE); 48 style = GetWindowLong(SDL_Window, GWL_STYLE);
49 GetWindowRect(SDL_Window, &rect); 49 GetWindowRect(SDL_Window, &rect);
50 DestroyWindow(SDL_Window); 50 DestroyWindow(SDL_Window);
51 WIN_FlushMessageQueue();
52
51 SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, 53 SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
52 style, 54 style,
53 rect.left, rect.top, 55 rect.left, rect.top,
54 (rect.right-rect.left)+1, 56 (rect.right-rect.left)+1,
55 (rect.top-rect.bottom)+1, 57 (rect.top-rect.bottom)+1,
56 NULL, NULL, SDL_Instance, NULL); 58 NULL, NULL, SDL_Instance, NULL);
59 WIN_FlushMessageQueue();
60
57 if ( SDL_Window ) { 61 if ( SDL_Window ) {
58 this->SetCaption(this, this->wm_title, this->wm_icon); 62 this->SetCaption(this, this->wm_title, this->wm_icon);
59 } else { 63 } else {
60 SDL_SetError("Couldn't create window"); 64 SDL_SetError("Couldn't create window");
61 status = -1; 65 status = -1;
116 const char *extensions; 120 const char *extensions;
117 121
118 hwnd = CreateWindow(SDL_Appname, SDL_Appname, WS_POPUP | WS_DISABLED, 122 hwnd = CreateWindow(SDL_Appname, SDL_Appname, WS_POPUP | WS_DISABLED,
119 0, 0, 10, 10, 123 0, 0, 10, 10,
120 NULL, NULL, SDL_Instance, NULL); 124 NULL, NULL, SDL_Instance, NULL);
125 WIN_FlushMessageQueue();
126
121 hdc = GetDC(hwnd); 127 hdc = GetDC(hwnd);
122 128
123 pformat = ChoosePixelFormat(hdc, &GL_pfd); 129 pformat = ChoosePixelFormat(hdc, &GL_pfd);
124 SetPixelFormat(hdc, pformat, &GL_pfd); 130 SetPixelFormat(hdc, pformat, &GL_pfd);
125 131
156 this->gl_data->wglMakeCurrent(NULL, NULL); 162 this->gl_data->wglMakeCurrent(NULL, NULL);
157 this->gl_data->wglDeleteContext(hglrc); 163 this->gl_data->wglDeleteContext(hglrc);
158 } 164 }
159 ReleaseDC(hwnd, hdc); 165 ReleaseDC(hwnd, hdc);
160 DestroyWindow(hwnd); 166 DestroyWindow(hwnd);
167 WIN_FlushMessageQueue();
161 } 168 }
162 169
163 #endif /* SDL_VIDEO_OPENGL */ 170 #endif /* SDL_VIDEO_OPENGL */
164 171
165 int WIN_GL_SetupWindow(_THIS) 172 int WIN_GL_SetupWindow(_THIS)