From 00f30b4f162d1c3e32ad0b49a8e278cde4c89ae7 Mon Sep 17 00:00:00 2001 From: David Snopek Date: Thu, 19 Jun 2025 07:13:37 -0500 Subject: [PATCH] Rename `OpenXRInterface.OpenXrSessionState` to `OpenXRInterface.SessionState` --- .../openxr/doc_classes/OpenXRInterface.xml | 26 +++++++++---------- modules/openxr/openxr_interface.cpp | 24 ++++++++--------- modules/openxr/openxr_interface.h | 24 ++++++++--------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/modules/openxr/doc_classes/OpenXRInterface.xml b/modules/openxr/doc_classes/OpenXRInterface.xml index 44c4a3bc033..5a490971be2 100644 --- a/modules/openxr/doc_classes/OpenXRInterface.xml +++ b/modules/openxr/doc_classes/OpenXRInterface.xml @@ -86,7 +86,7 @@ - + Returns the current state of our OpenXR session. @@ -222,7 +222,7 @@ - Informs our OpenXR session now has focus, e.g. output is sent to our HMD and we're receiving XR input. + Informs our OpenXR session now has focus, for example output is sent to the HMD and we're receiving XR input. @@ -242,38 +242,38 @@ - Informs our OpenXR session is now visible, e.g. output is being sent to the HMD but we don't receive XR input. + Informs our OpenXR session is now visible, for example output is sent to the HMD but we don't receive XR input. - + The state of the session is unknown, we haven't tried setting up OpenXR yet. - + The initial state after the OpenXR session is created or after the session is destroyed. - + OpenXR is ready to begin our session. [signal session_begun] is emitted when we change to this state. - + The application has synched its frame loop with the runtime but we're not rendering anything. [signal session_synchronized] is emitted when we change to this state. - + The application has synched its frame loop with the runtime and we're rendering output to the user, however we receive no user input. [signal session_visible] is emitted when we change to this state. - [b]Note:[/b] This is the current state just before we get the focused state, whenever the user opens a system menu, switches to another application or takes off their headset. + [b]Note:[/b] This is the current state just before we get the focused state, whenever the user opens a system menu, switches to another application, or takes off their headset. - + The application has synched its frame loop with the runtime, we're rendering output to the user and we're receiving XR input. [signal session_focussed] is emitted when we change to this state. [b]Note:[/b] This is the state OpenXR will be in when the user can fully interact with your game. - + Our session is being stopped. [signal session_stopping] is emitted when we change to this state. - + The session is about to be lost. [signal session_loss_pending] is emitted when we change to this state. - + The OpenXR instance is about to be destroyed and we're existing. [signal instance_exiting] is emitted when we change to this state. diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index 88d53120bd6..c5d644dd95a 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -120,15 +120,15 @@ void OpenXRInterface::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "vrs_min_radius", PROPERTY_HINT_RANGE, "1.0,100.0,1.0"), "set_vrs_min_radius", "get_vrs_min_radius"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "vrs_strength", PROPERTY_HINT_RANGE, "0.1,10.0,0.1"), "set_vrs_strength", "get_vrs_strength"); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_UNKNOWN); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_IDLE); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_READY); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_SYNCHRONIZED); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_VISIBLE); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_FOCUSED); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_STOPPING); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_LOSS_PENDING); - BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_EXITING); + BIND_ENUM_CONSTANT(SESSION_STATE_UNKNOWN); + BIND_ENUM_CONSTANT(SESSION_STATE_IDLE); + BIND_ENUM_CONSTANT(SESSION_STATE_READY); + BIND_ENUM_CONSTANT(SESSION_STATE_SYNCHRONIZED); + BIND_ENUM_CONSTANT(SESSION_STATE_VISIBLE); + BIND_ENUM_CONSTANT(SESSION_STATE_FOCUSED); + BIND_ENUM_CONSTANT(SESSION_STATE_STOPPING); + BIND_ENUM_CONSTANT(SESSION_STATE_LOSS_PENDING); + BIND_ENUM_CONSTANT(SESSION_STATE_EXITING); BIND_ENUM_CONSTANT(HAND_LEFT); BIND_ENUM_CONSTANT(HAND_RIGHT); @@ -1417,12 +1417,12 @@ void OpenXRInterface::on_refresh_rate_changes(float p_new_rate) { emit_signal(SNAME("refresh_rate_changed"), p_new_rate); } -OpenXRInterface::OpenXrSessionState OpenXRInterface::get_session_state() { +OpenXRInterface::SessionState OpenXRInterface::get_session_state() { if (openxr_api) { - return (OpenXrSessionState)openxr_api->get_session_state(); + return (SessionState)openxr_api->get_session_state(); } - return OPENXR_SESSION_STATE_UNKNOWN; + return SESSION_STATE_UNKNOWN; } /** Hand tracking. */ diff --git a/modules/openxr/openxr_interface.h b/modules/openxr/openxr_interface.h index a4d80891a83..71466293748 100644 --- a/modules/openxr/openxr_interface.h +++ b/modules/openxr/openxr_interface.h @@ -218,19 +218,19 @@ public: void tracker_profile_changed(RID p_tracker, RID p_interaction_profile); /** Session */ - enum OpenXrSessionState { // Should mirror XrSessionState - OPENXR_SESSION_STATE_UNKNOWN = 0, - OPENXR_SESSION_STATE_IDLE = 1, - OPENXR_SESSION_STATE_READY = 2, - OPENXR_SESSION_STATE_SYNCHRONIZED = 3, - OPENXR_SESSION_STATE_VISIBLE = 4, - OPENXR_SESSION_STATE_FOCUSED = 5, - OPENXR_SESSION_STATE_STOPPING = 6, - OPENXR_SESSION_STATE_LOSS_PENDING = 7, - OPENXR_SESSION_STATE_EXITING = 8, + enum SessionState { // Should mirror XrSessionState + SESSION_STATE_UNKNOWN = 0, + SESSION_STATE_IDLE = 1, + SESSION_STATE_READY = 2, + SESSION_STATE_SYNCHRONIZED = 3, + SESSION_STATE_VISIBLE = 4, + SESSION_STATE_FOCUSED = 5, + SESSION_STATE_STOPPING = 6, + SESSION_STATE_LOSS_PENDING = 7, + SESSION_STATE_EXITING = 8, }; - OpenXrSessionState get_session_state(); + SessionState get_session_state(); /** Hand tracking. */ enum Hand { @@ -337,7 +337,7 @@ public: ~OpenXRInterface(); }; -VARIANT_ENUM_CAST(OpenXRInterface::OpenXrSessionState) +VARIANT_ENUM_CAST(OpenXRInterface::SessionState) VARIANT_ENUM_CAST(OpenXRInterface::Hand) VARIANT_ENUM_CAST(OpenXRInterface::HandMotionRange) VARIANT_ENUM_CAST(OpenXRInterface::HandTrackedSource)