Skip to content

Commit 7b43e20

Browse files
committed
Support resolution changing back to dynamic on auto
1 parent a977f8d commit 7b43e20

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,16 @@ int main(int argc, char *argv[])
651651
#pragma region Getting data
652652
float currentRes = vr::VRSettings()->GetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_SupersampleScale_Float) * 100.0f;
653653

654-
// Check for external resolution change compatibility
654+
// Check for external resolution change (if resolution got changed and it wasn't us)
655655
if (externalResChangeCompatibility && std::fabs(newRes - currentRes) > 0.001f && !manualRes)
656656
manualRes = true;
657657

658+
// Check for end of external resolution change (if automatic resolution is enabled)
659+
if (externalResChangeCompatibility && !vr::VRSettings()->GetInt32(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_SupersampleManualOverride_Bool)) {
660+
vr::VRSettings()->SetInt32(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_SupersampleManualOverride_Bool, true);
661+
manualRes = false;
662+
}
663+
658664
// Fetch resolution and target fps
659665
newRes = currentRes;
660666
float lastRes = newRes;
@@ -965,7 +971,7 @@ int main(int argc, char *argv[])
965971
addTooltip("Number of frames' frametimes to average out.");
966972

967973
ImGui::Checkbox("External res change compatibility", &externalResChangeCompatibility);
968-
addTooltip("Automatically switch to manual resolution adjustment within the app when VR resolution is changed from an external source (SteamVR setting, Oyasumi, etc.) as to let the external source control the resolution. Does not automatically switch back to dynamic resolution adjustment.");
974+
addTooltip("Automatically switch to manual resolution adjustment within the app when VR resolution is changed from an external source (SteamVR setting, Oyasumi, etc.) as to let the external source control the resolution. Automatically switches back to dynamic resolution adjustment when resolution is set to automatic.");
969975

970976
ImGui::Text("Blacklist");
971977
addTooltip("Don't allow resolution changes in blacklisted applications.");

0 commit comments

Comments
 (0)