Add disable vsync and custom tickrate options
This commit is contained in:
@@ -72,12 +72,17 @@ constexpr int k_utilitiesSettingsUpdateCounter = 19;
|
||||
// k_nonVsyncTickRate determines number of ms we wait to force the next event
|
||||
// loop tick when vsync is too late due to dropped frames.
|
||||
constexpr int k_nonVsyncTickRate = 20;
|
||||
constexpr int k_maxCustomTickRate = 999;
|
||||
constexpr int k_hmdRotationCounterUpdateRate = 7;
|
||||
|
||||
class OverlayController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( bool m_desktopMode READ isDesktopMode )
|
||||
Q_PROPERTY( bool vsyncDisabled READ vsyncDisabled WRITE setVsyncDisabled
|
||||
NOTIFY vsyncDisabledChanged )
|
||||
Q_PROPERTY( int customTickRateMs READ customTickRateMs WRITE
|
||||
setCustomTickRateMs NOTIFY customTickRateMsChanged )
|
||||
|
||||
private:
|
||||
vr::VROverlayHandle_t m_ulOverlayHandle = vr::k_ulOverlayHandleInvalid;
|
||||
@@ -99,6 +104,8 @@ private:
|
||||
|
||||
bool m_desktopMode;
|
||||
bool m_noSound;
|
||||
bool m_vsyncDisabled = false;
|
||||
int m_customTickRateMs = 20;
|
||||
|
||||
QUrl m_runtimePathUrl;
|
||||
|
||||
@@ -111,6 +118,7 @@ private:
|
||||
uint64_t m_currentFrame = 0;
|
||||
uint64_t m_lastFrame = 0;
|
||||
int m_vsyncTooLateCounter = 0;
|
||||
int m_customTickRateCounter = 0;
|
||||
|
||||
input::SteamIVRInput m_actions;
|
||||
|
||||
@@ -194,6 +202,9 @@ public:
|
||||
vr::VREvent_t* pEvent );
|
||||
void mainEventLoop();
|
||||
|
||||
bool vsyncDisabled() const;
|
||||
int customTickRateMs() const;
|
||||
|
||||
public slots:
|
||||
void renderOverlay();
|
||||
void OnRenderRequest();
|
||||
@@ -207,8 +218,13 @@ public slots:
|
||||
void setAlarm01SoundVolume( float vol );
|
||||
void cancelAlarm01Sound();
|
||||
|
||||
void setVsyncDisabled( bool value, bool notify = true );
|
||||
void setCustomTickRateMs( int value, bool notify = true );
|
||||
|
||||
signals:
|
||||
void keyBoardInputSignal( QString input, unsigned long userValue = 0 );
|
||||
void vsyncDisabledChanged( bool value );
|
||||
void customTickRateMsChanged( int value );
|
||||
|
||||
private:
|
||||
static QSettings* _appSettings;
|
||||
|
||||
Reference in New Issue
Block a user