Implement Performance settings and VR mode top bar switch

This commit is contained in:
Zach Fox 2019-05-16 16:15:05 -07:00
parent fd5128f40f
commit 70a4d6e8d5
2 changed files with 41 additions and 2 deletions

View file

@ -13,6 +13,7 @@ import "../../simplifiedConstants" as SimplifiedConstants
import "../../simplifiedControls" as SimplifiedControls
import stylesUit 1.0 as HifiStylesUit
import QtQuick.Layouts 1.3
import PerformanceEnums 1.0
Flickable {
property string avatarNametagMode: Settings.getValue("simplifiedNametag/avatarNametagMode", "on")
@ -113,16 +114,28 @@ Flickable {
SimplifiedControls.RadioButton {
id: performanceLow
text: "Eco"
checked: Performance.getRefreshRateProfile() === RefreshRate.ECO
onClicked: {
Performance.setRefreshRateProfile(RefreshRate.ECO);
}
}
SimplifiedControls.RadioButton {
id: performanceMedium
text: "Interactive"
checked: Performance.getRefreshRateProfile() === RefreshRate.INTERACTIVE
onClicked: {
Performance.setRefreshRateProfile(RefreshRate.INTERACTIVE);
}
}
SimplifiedControls.RadioButton {
id: performanceHigh
text: "Realtime"
checked: Performance.getRefreshRateProfile() === RefreshRate.REALTIME
onClicked: {
Performance.setRefreshRateProfile(RefreshRate.REALTIME);
}
}
}
}

View file

@ -277,8 +277,34 @@ Rectangle {
}
onClicked: {
Tablet.playSound(TabletEnums.ButtonClick);
// TODO: actually do this right and change the display plugin
HMD.active = !HMD.active;
var displayPluginCount = Window.getDisplayPluginCount();
if (HMD.active) {
// This next line seems backwards and shouldn't be necessary - the NOTIFY handler should
// result in `displayModeImage.source` changing automatically - but that's not working.
// This is working. So, I'm keeping it.
displayModeImage.source = "./images/vrMode.svg";
// Switch to desktop mode - selects first VR display plugin
for (var i = 0; i < displayPluginCount; i++) {
if (!Window.isDisplayPluginHmd(i)) {
Window.setActiveDisplayPlugin(i);
return;
}
}
} else {
// This next line seems backwards and shouldn't be necessary - the NOTIFY handler should
// result in `displayModeImage.source` changing automatically - but that's not working.
// This is working. So, I'm keeping it.
displayModeImage.source = "./images/desktopMode.svg";
// Switch to VR mode - selects first HMD display plugin
for (var i = 0; i < displayPluginCount; i++) {
if (Window.isDisplayPluginHmd(i)) {
Window.setActiveDisplayPlugin(i);
return;
}
}
}
}
}
}