| Index: Help/html/config/display/videomode.htmlbody |
| — | — | @@ -20,4 +20,9 @@ |
| 21 | 21 | <h1>Custom display mode</h1>
|
| 22 | 22 | <p>Switches the display to the mode specified under “Custom resolution” and stretches the image to fit to that mode.</p>
|
| 23 | 23 | <h1>Custom size, centered</h1>
|
| 24 | | -<p>Stretches the primary surface to the size specified under “Custom resolution” and centers it on the display.</p> |
| \ No newline at end of file |
| | 24 | +<p>Stretches the primary surface to the size specified under “Custom resolution” and centers it on the display.</p>
|
| | 25 | +<p>
|
| | 26 | + <span style="font-size: 8pt;">
|
| | 27 | + <em>Custom size multiplier, Custom display mode, and Custom size, centered are implemented in DXGL 0.5.14 and later.</em>
|
| | 28 | + </span>
|
| | 29 | +</p> |
| \ No newline at end of file |
| Index: ddraw/glDirectDraw.cpp |
| — | — | @@ -2398,6 +2398,73 @@ |
| 2399 | 2399 | TRACE_EXIT(23, DD_OK);
|
| 2400 | 2400 | return DD_OK;
|
| 2401 | 2401 | break;
|
| | 2402 | + case 8: // Custom size multiplier
|
| | 2403 | + primaryx = dwWidth;
|
| | 2404 | + internalx = dwWidth * xscale;
|
| | 2405 | + if (dxglcfg.DisplayMultiplierX) internalx *= dxglcfg.DisplayMultiplierX;
|
| | 2406 | + screenx = currmode.dmPelsWidth;
|
| | 2407 | + primaryy = dwHeight;
|
| | 2408 | + internaly = dwHeight * yscale;
|
| | 2409 | + if (dxglcfg.DisplayMultiplierY) internaly *= dxglcfg.DisplayMultiplierY;
|
| | 2410 | + screeny = currmode.dmPelsHeight;
|
| | 2411 | + primarybpp = dwBPP;
|
| | 2412 | + if (dxglcfg.colormode) internalbpp = screenbpp = dwBPP;
|
| | 2413 | + else internalbpp = screenbpp = currmode.dmBitsPerPel;
|
| | 2414 | + if (dwRefreshRate) internalrefresh = primaryrefresh = screenrefresh = dwRefreshRate;
|
| | 2415 | + else internalrefresh = primaryrefresh = screenrefresh = currmode.dmDisplayFrequency;
|
| | 2416 | + InitGL(screenx, screeny, screenbpp, true, internalrefresh, hWnd, this, devwnd);
|
| | 2417 | + //glRenderer_SetBPP(this->renderer, primarybpp);
|
| | 2418 | + TRACE_EXIT(23, DD_OK);
|
| | 2419 | + return DD_OK;
|
| | 2420 | + break;
|
| | 2421 | + case 9: // Custom display mode
|
| | 2422 | + newmode.dmSize = sizeof(DEVMODE);
|
| | 2423 | + newmode.dmDriverExtra = 0;
|
| | 2424 | + newmode.dmPelsWidth = dxglcfg.CustomResolutionX;
|
| | 2425 | + newmode.dmPelsHeight = dxglcfg.CustomResolutionY;
|
| | 2426 | + if (dxglcfg.colormode)
|
| | 2427 | + newmode.dmBitsPerPel = dwBPP;
|
| | 2428 | + else newmode.dmBitsPerPel = currmode.dmBitsPerPel;
|
| | 2429 | + newmode.dmDisplayFrequency = dxglcfg.CustomRefresh;
|
| | 2430 | + if (dxglcfg.CustomRefresh) newmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
|
| | 2431 | + else newmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
| | 2432 | + flags = 0;
|
| | 2433 | + if (fullscreen) flags |= CDS_FULLSCREEN;
|
| | 2434 | + error = ChangeDisplaySettingsEx(NULL, &newmode, NULL, flags, NULL);
|
| | 2435 | + if (error == DISP_CHANGE_SUCCESSFUL) currmode = newmode;
|
| | 2436 | + primaryx = dwWidth;
|
| | 2437 | + internalx = screenx = currmode.dmPelsWidth;
|
| | 2438 | + primaryy = dwHeight;
|
| | 2439 | + internaly = screeny = currmode.dmPelsHeight;
|
| | 2440 | + if (crop400) internaly *= 1.2f;
|
| | 2441 | + if (dxglcfg.colormode) internalbpp = screenbpp = dwBPP;
|
| | 2442 | + else internalbpp = screenbpp = currmode.dmBitsPerPel;
|
| | 2443 | + if (dwRefreshRate) internalrefresh = primaryrefresh = screenrefresh = dwRefreshRate;
|
| | 2444 | + else internalrefresh = primaryrefresh = screenrefresh = currmode.dmDisplayFrequency;
|
| | 2445 | + primarybpp = dwBPP;
|
| | 2446 | + InitGL(screenx, screeny, screenbpp, true, internalrefresh, hWnd, this, devwnd);
|
| | 2447 | + //glRenderer_SetBPP(this->renderer, primarybpp);
|
| | 2448 | + primarylost = true;
|
| | 2449 | + TRACE_EXIT(23, DD_OK);
|
| | 2450 | + return DD_OK;
|
| | 2451 | + break;
|
| | 2452 | + case 10: // Custom size, centered
|
| | 2453 | + primaryx = dwWidth;
|
| | 2454 | + internalx = dxglcfg.CustomResolutionX;
|
| | 2455 | + screenx = currmode.dmPelsWidth;
|
| | 2456 | + primaryy = dwHeight;
|
| | 2457 | + internaly = dxglcfg.CustomResolutionY;
|
| | 2458 | + screeny = currmode.dmPelsHeight;
|
| | 2459 | + primarybpp = dwBPP;
|
| | 2460 | + if (dxglcfg.colormode) internalbpp = screenbpp = dwBPP;
|
| | 2461 | + else internalbpp = screenbpp = currmode.dmBitsPerPel;
|
| | 2462 | + if (dwRefreshRate) internalrefresh = primaryrefresh = screenrefresh = dwRefreshRate;
|
| | 2463 | + else internalrefresh = primaryrefresh = screenrefresh = currmode.dmDisplayFrequency;
|
| | 2464 | + InitGL(screenx, screeny, screenbpp, true, internalrefresh, hWnd, this, devwnd);
|
| | 2465 | + //glRenderer_SetBPP(this->renderer, primarybpp);
|
| | 2466 | + TRACE_EXIT(23, DD_OK);
|
| | 2467 | + return DD_OK;
|
| | 2468 | + break;
|
| 2402 | 2469 | }
|
| 2403 | 2470 | break;
|
| 2404 | 2471 | case 2:
|