1
0
mirror of https://github.com/CLfamilaris/VRDOM.git synced 2024-11-27 20:20:49 +01:00
VRDOM/scripts/RootInit.cs

25 lines
680 B
C#
Raw Normal View History

using Godot;
public partial class RootInit : Node3D
{
private XRInterface _xrInterface;
public override void _Ready()
{
_xrInterface = XRServer.FindInterface("OpenXR");
2023-08-03 21:47:18 +02:00
if (_xrInterface != null && _xrInterface.IsInitialized())
{
GD.Print("OpenXR initialized successfully");
// Turn off v-sync!
DisplayServer.WindowSetVsyncMode(DisplayServer.VSyncMode.Disabled);
// Change our main viewport to output to the HMD
GetViewport().UseXR = true;
}
else
{
GD.Print("OpenXR not initialized, please check if your headset is connected");
}
}
}