DXGL r640 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r639‎ | r640 | r641 >
Date:00:41, 17 January 2016
Author:admin
Status:new
Tags:
Comment:
Handle window resizing.
Fix caption for fullscreen window mode in dxglcfg
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glDirectDraw.h (modified) (history)
  • /ddraw/hooks.c (modified) (history)
  • /dxglcfg/dxglcfg.rc (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -1435,6 +1435,13 @@
14361436 {
14371437 glDD7->GetSizes(sizes);
14381438 }
 1439+extern "C" void glDirectDraw7_SetWindowSize(glDirectDraw7 *glDD7, DWORD dwWidth, DWORD dwHeight)
 1440+{
 1441+ glDD7->internalx = glDD7->screenx = dwWidth;
 1442+ glDD7->internaly = glDD7->screeny = dwHeight;
 1443+ if (glDD7->renderer && glDD7->primary) glRenderer_DrawScreen(glDD7->renderer, glDD7->primary->texture,
 1444+ glDD7->primary->paltex, glDD7->primary, glDD7->primary, 0);
 1445+}
14391446
14401447
14411448 HRESULT WINAPI glDirectDraw7::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
Index: ddraw/glDirectDraw.h
@@ -142,6 +142,8 @@
143143 };
144144
145145 extern "C" void glDirectDraw7_UnrestoreDisplayMode(glDirectDraw7 *This);
 146+extern "C" void glDirectDraw7_GetSizes(glDirectDraw7 *glDD7, LONG *sizes);
 147+extern "C" void glDirectDraw7_SetWindowSize(glDirectDraw7 *glDD7, DWORD dwWidth, DWORD dwHeight);
146148
147149 class glDirectDraw1 : public IDirectDraw
148150 {
Index: ddraw/hooks.c
@@ -22,6 +22,7 @@
2323
2424 // temporary references to C++ C-linked stuff
2525 void glDirectDraw7_UnrestoreDisplayMode(LPDIRECTDRAW7 lpDD7);
 26+void glDirectDraw7_SetWindowSize(LPDIRECTDRAW7 lpDD7, DWORD dwWidth, DWORD dwHeight);
2627 extern DXGLCFG dxglcfg;
2728
2829 const TCHAR *wndprop = _T("DXGLWndProc");
@@ -281,6 +282,14 @@
282283 if (lpDD7 && (dxglcfg.fullmode < 2)) glDirectDraw7_UnrestoreDisplayMode(lpDD7);
283284 }
284285 break;
 286+ case WM_SIZE:
 287+ if (wParam != SIZE_MINIMIZED)
 288+ {
 289+ if (dxglcfg.fullmode == 3)
 290+ {
 291+ if (lpDD7) glDirectDraw7_SetWindowSize(lpDD7, LOWORD(lParam), HIWORD(lParam));
 292+ }
 293+ }
285294 }
286295 return CallWindowProc(parentproc, hWnd, uMsg, wParam, lParam);
287296 }
Index: dxglcfg/dxglcfg.rc
@@ -47,7 +47,7 @@
4848 AUTOCHECKBOX "Change display color depth", IDC_COLOR, 299, 14, 100, 10
4949 LTEXT "Scaling method", IDC_STATIC, 195, 69, 49, 8, SS_LEFT
5050 COMBOBOX IDC_SCALE, 195, 79, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
51 - LTEXT "Fullscreen mode", IDC_STATIC, 299, 69, 41, 8, SS_LEFT
 51+ LTEXT "Fullscreen window mode", IDC_STATIC, 299, 69, 78, 8, SS_LEFT
5252 COMBOBOX IDC_FULLMODE, 299, 79, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
5353 LTEXT "Post-processing shader", IDC_STATIC, 195, 94, 90, 8, SS_LEFT
5454 EDITTEXT IDC_SHADER, 195, 104, 183, 14, ES_AUTOHSCROLL