Skip to content

Commit f1b8819

Browse files
committed
Added call to CheckDisplayStartup and setting flag when DisplayConfig has received its first pose. This fixes the error when no HMD is connected.
1 parent d97dfcb commit f1b8819

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class DisplayController : MonoBehaviour
5252
private uint _viewerCount;
5353
private bool _renderedStereo = false;
5454
private bool _displayConfigInitialized = false;
55+
private bool _checkDisplayStartup = false;
5556
private Camera _camera;
5657
private bool _disabledCamera = true;
5758

@@ -210,11 +211,19 @@ void OnPreCull()
210211
//update the client
211212
UpdateClient();
212213

213-
//update the viewer's head pose
214-
viewer.UpdateViewerHeadPose(DisplayConfig.GetViewerPose(viewerIndex));
214+
//update poses once DisplayConfig is ready
215+
if (_checkDisplayStartup)
216+
{
217+
//update the viewer's head pose
218+
viewer.UpdateViewerHeadPose(DisplayConfig.GetViewerPose(viewerIndex));
215219

216-
//each viewer update its eyes
217-
viewer.UpdateEyes();
220+
//each viewer update its eyes
221+
viewer.UpdateEyes();
222+
}
223+
else
224+
{
225+
_checkDisplayStartup = DisplayConfig.CheckDisplayStartup();
226+
}
218227
}
219228

220229
// Flag that we disabled the camera

0 commit comments

Comments
 (0)