mirror of
https://github.com/CLfamilaris/VRDOM.git
synced 2024-11-11 22:47:09 +01:00
25 lines
680 B
C#
25 lines
680 B
C#
using Godot;
|
|
|
|
public partial class RootInit : Node3D
|
|
{
|
|
private XRInterface _xrInterface;
|
|
|
|
public override void _Ready()
|
|
{
|
|
_xrInterface = XRServer.FindInterface("OpenXR");
|
|
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");
|
|
}
|
|
}
|
|
} |