DXGL r559 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r558‎ | r559 | r560 >
Date:16:53, 25 October 2014
Author:admin
Status:new
Tags:
Comment:
Adjust fullscreen window management slightly.
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -1425,9 +1425,23 @@
14261426 if(hWnd && !IsWindow(hWnd)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
14271427 if ((dwFlags & DDSCL_EXCLUSIVE) && !hWnd) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
14281428 if(dwFlags & 0xFFFFE020) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 1429+ if (((hWnd != this->hWnd) && this->hWnd) || (this->hWnd && (dwFlags & DDSCL_NORMAL)))
 1430+ {
 1431+ if (winstyle)
 1432+ {
 1433+ SetWindowLongPtrA(hWnd, GWL_STYLE, winstyle);
 1434+ SetWindowLongPtrA(hWnd, GWL_EXSTYLE, winstyleex);
 1435+ //ShowWindow(hWnd, SW_RESTORE);
 1436+ winstyle = winstyleex = 0;
 1437+ SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
 1438+ }
 1439+ }
14291440 this->hWnd = hWnd;
1430 - winstyle = GetWindowLongPtrA(hWnd,GWL_STYLE);
1431 - winstyleex = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
 1441+ if (!winstyle && !winstyleex)
 1442+ {
 1443+ winstyle = GetWindowLongPtrA(hWnd, GWL_STYLE);
 1444+ winstyleex = GetWindowLongPtrA(hWnd, GWL_EXSTYLE);
 1445+ }
14321446 bool exclusive = false;
14331447 devwnd = false;
14341448 if(dwFlags & DDSCL_ALLOWMODEX)
Index: ddraw/glRenderer.cpp
@@ -203,6 +203,7 @@
204204 */
205205 void glRenderer_Init(glRenderer *This, int width, int height, int bpp, bool fullscreen, unsigned int frequency, HWND hwnd, glDirectDraw7 *glDD7, BOOL devwnd)
206206 {
 207+ LONG_PTR winstyle, winstyleex;
207208 This->oldswap = 0;
208209 This->fogcolor = 0;
209210 This->fogstart = 0.0f;
@@ -219,8 +220,10 @@
220221 This->start = CreateEvent(NULL,FALSE,FALSE,NULL);
221222 if(fullscreen)
222223 {
223 - SetWindowLongPtrA(This->hWnd,GWL_EXSTYLE,WS_EX_APPWINDOW);
224 - SetWindowLongPtrA(This->hWnd,GWL_STYLE,WS_OVERLAPPED);
 224+ winstyle = GetWindowLongPtrA(This->hWnd, GWL_STYLE);
 225+ winstyleex = GetWindowLongPtrA(This->hWnd, GWL_EXSTYLE);
 226+ SetWindowLongPtrA(This->hWnd, GWL_EXSTYLE, winstyleex & ~(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE));
 227+ SetWindowLongPtrA(This->hWnd, GWL_STYLE, (winstyle | WS_POPUP | WS_SYSMENU) & ~(WS_CAPTION | WS_THICKFRAME));
225228 ShowWindow(This->hWnd,SW_MAXIMIZE);
226229 }
227230 if(width)

Follow-up revisions

RevisionCommit summaryAuthorDate
r560Comment out broken code in r559admin17:57, 26 October 2014