make borderless popup windows style optional
This commit is contained in:
@@ -63,6 +63,8 @@ FRM.Motion.Rate=300
|
||||
Display=1
|
||||
Width=1280
|
||||
Height=720
|
||||
# Make borderless mode use a popup window (better performance/lower latency, but can cause screenshot issues)
|
||||
Borderless.Popup=1
|
||||
# Fullscreen only options
|
||||
BitDepth=32
|
||||
RefreshRate=60
|
||||
|
||||
@@ -172,6 +172,7 @@ ConfigOptionBase* optionsArray[] = {
|
||||
|
||||
new BooleanOption(L"TAA", GRAPHICS_SECTION, CONFIG_FILE, L"TAA", L"Temporal Anti-Aliasing", true, false),
|
||||
new BooleanOption(L"MLAA", GRAPHICS_SECTION, CONFIG_FILE, L"MLAA", L"Morphological Anti-Aliasing", true, false),
|
||||
new BooleanOption(L"borderless.popup", RESOLUTION_SECTION, CONFIG_FILE, L"Popup Borderless Mode", L"Makes borderless mode use a popup window.\nPerformance may increase and latency should decrease, but screenshots may not work as expected.", true, false),
|
||||
new BooleanOption(L"FPS.Limit.LightMode", GRAPHICS_SECTION, CONFIG_FILE, L"Use Lightweight Limiter", L"Makes the FPS limiter use less CPU.\nMay have less consistent performance.", true, false),
|
||||
new NumericOption(L"FPS.Limit", GRAPHICS_SECTION, CONFIG_FILE, L"FPS Limit:", L"Allows you to set a frame rate cap. Set to -1 to unlock the frame rate.", 60, -1, INT_MAX),
|
||||
new NumericOption(L"frm.motion.rate", GRAPHICS_SECTION, CONFIG_FILE, L"FRM Motion Rate:", L"Sets the motion rate (fps) for the Frame Rate Manager component.\nLarger values should be smoother, but more CPU intensive and possibly buggier.", 300, 1, INT_MAX),
|
||||
|
||||
@@ -74,7 +74,12 @@ int hookedCreateWindow(const char* title, void(__cdecl* exit_function)(int))
|
||||
HDC hDev = wglGetCurrentDC(); // get handle to current opengl device context
|
||||
HWND hWnd = WindowFromDC(hDev); // convert it to a window handle
|
||||
|
||||
SetWindowLongPtr(hWnd, GWL_STYLE, WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); // set no border (visible to ensure something is shown immediately)
|
||||
LONG_PTR wndStyle = WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; // set no border (visible to ensure something is shown immediately)
|
||||
|
||||
if (nPopupBorderless)
|
||||
wndStyle |= WS_POPUP;
|
||||
|
||||
SetWindowLongPtr(hWnd, GWL_STYLE, wndStyle);
|
||||
SetWindowPos(hWnd, HWND_TOP, wndX, wndY, nWidth, nHeight, SWP_FRAMECHANGED); // adjust position to apply new style
|
||||
|
||||
printf("[Render Manager] Borderless mode.\n");
|
||||
|
||||
@@ -35,6 +35,8 @@ int nIntResHeight = GetPrivateProfileIntW(L"resolution", L"r.height", 720, CONFI
|
||||
int nBitDepth = GetPrivateProfileIntW(L"resolution", L"bitdepth", 32, CONFIG_FILE);
|
||||
int nRefreshRate = GetPrivateProfileIntW(L"resolution", L"refreshrate", 60, CONFIG_FILE);
|
||||
|
||||
int nPopupBorderless = GetPrivateProfileIntW(L"resolution", L"borderless.popup", TRUE, CONFIG_FILE);
|
||||
|
||||
int nFpsLimit = GetPrivateProfileIntW(L"graphics", L"fps.limit", 60, CONFIG_FILE);
|
||||
int nUseLightLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.lightmode", TRUE, CONFIG_FILE);
|
||||
int nVerboseLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.verbose", FALSE, CONFIG_FILE);
|
||||
|
||||
Reference in New Issue
Block a user