Index: cfgmgr/cfgmgr.c |
— | — | @@ -648,6 +648,7 @@ |
649 | 649 | cfg->WindowWidth = ReadDWORD(hKey, cfg->WindowWidth, &cfgmask->WindowWidth, _T("WindowWidth"));
|
650 | 650 | cfg->WindowHeight = ReadDWORD(hKey, cfg->WindowHeight, &cfgmask->WindowHeight, _T("WindowHeight"));
|
651 | 651 | cfg->WindowMaximized = ReadDWORD(hKey, cfg->WindowMaximized, &cfgmask->WindowMaximized, _T("WindowMaximized"));
|
| 652 | + cfg->CaptureMouse = ReadDWORD(hKey, cfg->CaptureMouse, &cfgmask->CaptureMouse, _T("CaptureMouse"));
|
652 | 653 | ReadWindowPos(hKey, cfg, cfgmask);
|
653 | 654 | cfg->Windows8Detected = ReadBool(hKey,cfg->Windows8Detected,&cfgmask->Windows8Detected,_T("Windows8Detected"));
|
654 | 655 | cfg->DPIScale = ReadDWORD(hKey,cfg->DPIScale,&cfgmask->DPIScale,_T("DPIScale"));
|
— | — | @@ -802,6 +803,7 @@ |
803 | 804 | WriteDWORD(hKey, cfg->WindowWidth, cfgmask->WindowWidth, _T("WindowWidth"));
|
804 | 805 | WriteDWORD(hKey, cfg->WindowHeight, cfgmask->WindowHeight, _T("WindowHeight"));
|
805 | 806 | WriteDWORD(hKey, cfg->WindowMaximized, cfgmask->WindowMaximized, _T("WindowMaximized"));
|
| 807 | + WriteDWORD(hKey, cfg->CaptureMouse, cfgmask->CaptureMouse, _T("CaptureMouse"));
|
806 | 808 | WriteBool(hKey,cfg->Windows8Detected,cfgmask->Windows8Detected,_T("Windows8Detected"));
|
807 | 809 | WriteDWORD(hKey,cfg->DPIScale,cfgmask->DPIScale,_T("DPIScale"));
|
808 | 810 | WriteFloat(hKey, cfg->aspect, cfgmask->aspect, _T("ScreenAspect"));
|
— | — | @@ -1084,6 +1086,7 @@ |
1085 | 1087 | if (!_stricmp(name, "WindowWidth")) cfg->WindowWidth = INIIntValue(value);
|
1086 | 1088 | if (!_stricmp(name, "WindowHeight")) cfg->WindowHeight = INIIntValue(value);
|
1087 | 1089 | if (!_stricmp(name, "WindowMaximized")) cfg->WindowMaximized = INIBoolValue(value);
|
| 1090 | + if (!_stricmp(name, "CaptureMouse")) cfg->CaptureMouse = INIBoolValue(value);
|
1088 | 1091 | }
|
1089 | 1092 | if (!_stricmp(section, "debug"))
|
1090 | 1093 | {
|
Index: cfgmgr/cfgmgr.h |
— | — | @@ -78,6 +78,7 @@ |
79 | 79 | DWORD WindowWidth;
|
80 | 80 | DWORD WindowHeight;
|
81 | 81 | BOOL WindowMaximized;
|
| 82 | + BOOL CaptureMouse;
|
82 | 83 | // [debug]
|
83 | 84 | BOOL DebugNoExtFramebuffer;
|
84 | 85 | BOOL DebugNoArbFramebuffer;
|
Index: ddraw/hooks.c |
— | — | @@ -403,8 +403,34 @@ |
404 | 404 | if (lpDD7 && (dxglcfg.fullmode < 2)) glDirectDraw7_UnrestoreDisplayMode(lpDD7);
|
405 | 405 | }
|
406 | 406 | break;
|
| 407 | + case WM_LBUTTONDOWN:
|
| 408 | + if (lpDD7)
|
| 409 | + {
|
| 410 | + if (((dxglcfg.scaler != 0) || ((dxglcfg.fullmode >= 2) && (dxglcfg.fullmode <= 4)))
|
| 411 | + && glDirectDraw7_GetFullscreen(lpDD7))
|
| 412 | + {
|
| 413 | + oldx = LOWORD(lParam);
|
| 414 | + oldy = HIWORD(lParam);
|
| 415 | + glDirectDraw7_GetSizes(lpDD7, sizes);
|
| 416 | + mulx = (float)sizes[2] / (float)sizes[0];
|
| 417 | + muly = (float)sizes[3] / (float)sizes[1];
|
| 418 | + translatex = (sizes[4] - sizes[0]) / 2;
|
| 419 | + translatey = (sizes[5] - sizes[1]) / 2;
|
| 420 | + oldx -= translatex;
|
| 421 | + oldy -= translatey;
|
| 422 | + oldx = (int)((float)oldx * mulx);
|
| 423 | + oldy = (int)((float)oldy * muly);
|
| 424 | + if (oldx < 0) oldx = 0;
|
| 425 | + if (oldy < 0) oldy = 0;
|
| 426 | + if (oldx >= sizes[2]) oldx = sizes[2] - 1;
|
| 427 | + if (oldy >= sizes[3]) oldy = sizes[3] - 1;
|
| 428 | + newpos = oldx + (oldy << 16);
|
| 429 | + return CallWindowProc(parentproc, hWnd, uMsg, wParam, newpos);
|
| 430 | + }
|
| 431 | + else return CallWindowProc(parentproc, hWnd, uMsg, wParam, lParam);
|
| 432 | + }
|
| 433 | + else return CallWindowProc(parentproc, hWnd, uMsg, wParam, lParam);
|
407 | 434 | case WM_MOUSEMOVE:
|
408 | | - case WM_LBUTTONDOWN:
|
409 | 435 | case WM_LBUTTONUP:
|
410 | 436 | case WM_LBUTTONDBLCLK:
|
411 | 437 | case WM_RBUTTONDOWN:
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -2056,6 +2056,11 @@ |
2057 | 2057 | EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
2058 | 2058 | *dirty = TRUE;
|
2059 | 2059 | break;
|
| 2060 | + case IDC_CAPTUREMOUSE:
|
| 2061 | + cfg->CaptureMouse = GetCheck(hWnd, IDC_CAPTUREMOUSE, &cfgmask->CaptureMouse);
|
| 2062 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2063 | + *dirty = TRUE;
|
| 2064 | + break;
|
2060 | 2065 | default:
|
2061 | 2066 | break;
|
2062 | 2067 | }
|
— | — | @@ -2606,7 +2611,6 @@ |
2607 | 2612 | int newtab;
|
2608 | 2613 | DWORD dpisupport;
|
2609 | 2614 | TCITEM tab;
|
2610 | | - int progresscount;
|
2611 | 2615 | HWND hProgressWnd;
|
2612 | 2616 | switch (Msg)
|
2613 | 2617 | {
|
— | — | @@ -3114,6 +3118,9 @@ |
3115 | 3119 | // No autosize
|
3116 | 3120 | if (cfg->NoResizeWindow) SendDlgItemMessage(hTabs[3], IDC_NOAUTOSIZE, BM_SETCHECK, BST_CHECKED, 0);
|
3117 | 3121 | else SendDlgItemMessage(hTabs[3], IDC_NOAUTOSIZE, BM_SETCHECK, BST_UNCHECKED, 0);
|
| 3122 | + // Capture mouse
|
| 3123 | + if (cfg->CaptureMouse) SendDlgItemMessage(hTabs[3], IDC_CAPTUREMOUSE, BM_SETCHECK, BST_CHECKED, 0);
|
| 3124 | + else SendDlgItemMessage(hTabs[3], IDC_CAPTUREMOUSE, BM_SETCHECK, BST_UNCHECKED, 0);
|
3118 | 3125 | // DPI
|
3119 | 3126 | dpisupport = GetDPISupportLevel();
|
3120 | 3127 | _tcscpy(buffer, _T("Disabled"));
|
— | — | @@ -3244,7 +3251,6 @@ |
3245 | 3252 | // Add installed programs
|
3246 | 3253 | current_app = 1;
|
3247 | 3254 | appcount = 1;
|
3248 | | - progresscount = 1;
|
3249 | 3255 | regbuffersize = 1024;
|
3250 | 3256 | regbuffer = (LPTSTR)malloc(regbuffersize * sizeof(TCHAR));
|
3251 | 3257 | RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\DXGL\\Profiles"), 0, NULL, 0, KEY_READ, NULL, &hKeyBase, NULL);
|
— | — | @@ -3254,9 +3260,6 @@ |
3255 | 3261 | keysize2 = keysize;
|
3256 | 3262 | i = 0;
|
3257 | 3263 | while (RegEnumKeyEx(hKeyBase, i, keyname, &keysize2, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
3258 | | - progresscount++;
|
3259 | | - i = 0;
|
3260 | | - while (RegEnumKeyEx(hKeyBase, i, keyname, &keysize2, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
3261 | 3264 | {
|
3262 | 3265 | keysize2 = keysize;
|
3263 | 3266 | i++;
|
— | — | @@ -3540,6 +3543,7 @@ |
3541 | 3544 | SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWSIZE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
|
3542 | 3545 | SendDlgItemMessage(hTabs[3], IDC_WINDOWMAXIMIZED, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
|
3543 | 3546 | SendDlgItemMessage(hTabs[3], IDC_NOAUTOSIZE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
|
| 3547 | + SendDlgItemMessage(hTabs[3], IDC_CAPTUREMOUSE, BM_SETSTYLE, BS_AUTO3STATE, TRUE);
|
3544 | 3548 | // Debug tab
|
3545 | 3549 | SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
3546 | 3550 | }
|
— | — | @@ -3699,6 +3703,7 @@ |
3700 | 3704 | SetInteger(hTabs[3], IDC_WINDOWHEIGHT, cfg->WindowHeight, cfgmask->WindowHeight);
|
3701 | 3705 | SetCheck(hTabs[3], IDC_WINDOWMAXIMIZED, cfg->WindowMaximized, cfgmask->WindowMaximized, tristate);
|
3702 | 3706 | SetCheck(hTabs[3], IDC_NOAUTOSIZE, cfg->NoResizeWindow, cfgmask->NoResizeWindow, tristate);
|
| 3707 | + SetCheck(hTabs[3], IDC_CAPTUREMOUSE, cfg->CaptureMouse, cfgmask->CaptureMouse, tristate);
|
3703 | 3708 | // Debug tab
|
3704 | 3709 | RedrawWindow(GetDlgItem(hTabs[4], IDC_DEBUGLIST), NULL, NULL, RDW_INVALIDATE);
|
3705 | 3710 | SetGLCombo(hTabs[4], IDC_GLVERSION, &cfg->DebugMaxGLVersionMajor, &cfg->DebugMaxGLVersionMinor,
|
Index: dxglcfg/dxglcfg.rc |
— | — | @@ -130,6 +130,7 @@ |
131 | 131 | EDITTEXT IDC_WINDOWHEIGHT, 172, 69, 40, 14, ES_AUTOHSCROLL, WS_EX_LEFT
|
132 | 132 | AUTOCHECKBOX "Start resizable window maximized", IDC_WINDOWMAXIMIZED, 7, 88, 120, 8, 0, WS_EX_LEFT
|
133 | 133 | AUTOCHECKBOX "Don't auto-size window in resizable window mode", IDC_NOAUTOSIZE, 7, 101, 171, 8, 0, WS_EX_LEFT
|
| 134 | + AUTOCHECKBOX "Capture mouse in window mode (Press Ctrl+Alt to release)", IDC_CAPTUREMOUSE, 7, 114, 196, 8, 0, WS_EX_LEFT
|
134 | 135 | LTEXT "Installation path", IDC_PATHLABEL, 7, 124, 51, 9, SS_LEFT, WS_EX_LEFT
|
135 | 136 | EDITTEXT IDC_PROFILEPATH, 7, 135, 331, 14, NOT WS_BORDER | NOT WS_TABSTOP | ES_AUTOHSCROLL | ES_READONLY, WS_EX_LEFT
|
136 | 137 | // Removed for DXGL 0.5.13 release
|
Index: dxglcfg/resource.h |
— | — | @@ -115,9 +115,10 @@ |
116 | 116 | #define IDC_WINDOWHEIGHT 2311
|
117 | 117 | #define IDC_WINDOWMAXIMIZED 2312
|
118 | 118 | #define IDC_NOAUTOSIZE 2313
|
119 | | -#define IDC_PATHLABEL 2314
|
120 | | -#define IDC_PROFILEPATH 2315
|
121 | | -#define IDC_WRITEINI 2316
|
| 119 | +#define IDC_CAPTUREMOUSE 2314
|
| 120 | +#define IDC_PATHLABEL 2315
|
| 121 | +#define IDC_PROFILEPATH 2316
|
| 122 | +#define IDC_WRITEINI 2317
|
122 | 123 |
|
123 | 124 | // Controls - Debug Tab
|
124 | 125 | #define IDC_DEBUGLIST 2401
|