using Godot;
using System;

public partial class XrOrigin3d : XROrigin3D
{
    private XRInterface _xrInterface;

    public override void _Ready()
    {
        _xrInterface = XRServer.FindInterface("OpenXR");
        if (_xrInterface == null || !_xrInterface.IsInitialized())
            GD.PushError("Failed to initialize OpenXR");

        GD.Print("OpenXR Initialized successfully");

        DisplayServer.WindowSetVsyncMode(DisplayServer.VSyncMode.Disabled);
        GetViewport().UseXR = true;
    }
}
