Skip to content

Commit ccad22d

Browse files
committed
Set Applicatoin.targetFrameRate to TARGET_FRAME_RATE const
1 parent 2f80bab commit ccad22d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

OSVR-Unity/Assets/OSVRUnity/src/DisplayController.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class DisplayController : MonoBehaviour
3737
{
3838

3939
public const uint NUM_VIEWERS = 1;
40+
private const int TARGET_FRAME_RATE = 60; //@todo get from OSVR
4041

4142
private ClientKit _clientKit;
4243
private OSVR.ClientKit.DisplayConfig _displayConfig;
@@ -97,8 +98,10 @@ void SetupApplicationSettings()
9798
//VR should never timeout the screen:
9899
Screen.sleepTimeout = SleepTimeout.NeverSleep;
99100

100-
//60 FPS whenever possible:
101-
Application.targetFrameRate = 60;
101+
//Set the framerate
102+
//@todo get this value from OSVR, not a const value
103+
//Performance note: Developers should try setting Time.fixedTimestep to 1/Application.targetFrameRate
104+
Application.targetFrameRate = TARGET_FRAME_RATE;
102105
}
103106

104107
void SetupDisplay()

0 commit comments

Comments
 (0)