Gathering all the needed settings in one place

This commit is contained in:
Sam Gateau 2019-05-28 21:55:17 -07:00
parent 0862e40b41
commit aedc631c45
5 changed files with 29 additions and 5 deletions

View file

@ -27,6 +27,11 @@ PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface:
return (PerformanceScriptingInterface::RefreshRateProfile)qApp->getRefreshRateManager().getRefreshRateProfile();
}
QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
static const QStringList refreshRateProfileNames = { "Eco", "Interactive", "Realtime" };
return refreshRateProfileNames;
}
int PerformanceScriptingInterface::getActiveRefreshRate() const {
return qApp->getRefreshRateManager().getActiveRefreshRate();
}

View file

@ -33,14 +33,15 @@ public:
~PerformanceScriptingInterface() = default;
public slots:
void setRefreshRateProfile(RefreshRateProfile refreshRateProfile);
RefreshRateProfile getRefreshRateProfile() const;
QStringList getRefreshRateProfileNames() const;
int getActiveRefreshRate() const;
RefreshRateManager::UXMode getUXMode() const;
RefreshRateManager::RefreshRateRegime getRefreshRateRegime() const;
private:
static std::once_flag registry_flag;
};

View file

@ -48,6 +48,11 @@ void RenderScriptingInterface::setRenderMethod(RenderScriptingInterface::RenderM
}
}
QStringList RenderScriptingInterface::getRenderMethodNames() const {
static const QStringList refrenderMethodNames = { "Deferred", "Forward" };
return refrenderMethodNames;
}
bool RenderScriptingInterface::getShadowsEnabled() {
return _shadowsEnabledSetting.get();
}

View file

@ -68,6 +68,14 @@ public slots:
*/
void setRenderMethod(RenderMethod renderMethod);
/**jsdoc
* Gets the possible enum names of the RenderMethod type
* @function Render.getRenderMethodNames
* @returns [string] [ <code>"DEFERRED"</code>, <code>"FORWARD"</code> ]
*/
QStringList getRenderMethodNames() const;
/**jsdoc
* Whether or not shadows are enabled
* @function Render.getShadowsEnabled

View file

@ -19,14 +19,19 @@ Column {
anchors.fill: parent
id: theGrapchicsSettings;
Prop.PropEnum {
label: "Refresh Rate Profile"
//object: Performance
valueVarSetter: Performance.setRefreshRateProfile
valueVarGetter: Performance.getRefreshRateProfile
enums: Performance.getRefreshRateProfileNames()
}
Prop.PropEnum {
label: "Render Method"
object: Render
property: "renderMethod"
enums: [
"Deferred",
"Forward"
]
enums: Render.getRenderMethodNames()
}
Prop.PropBool {