Skip to content

Commit 48f361a

Browse files
committed
Merge pull request #107710 from dsnopek/openxr-interface-rename-session-state
Rename `OpenXRInterface.OpenXrSessionState` to `OpenXRInterface.SessionState`
2 parents 4de0f1b + 00f30b4 commit 48f361a

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

modules/openxr/doc_classes/OpenXRInterface.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
</description>
8787
</method>
8888
<method name="get_session_state">
89-
<return type="int" enum="OpenXRInterface.OpenXrSessionState" />
89+
<return type="int" enum="OpenXRInterface.SessionState" />
9090
<description>
9191
Returns the current state of our OpenXR session.
9292
</description>
@@ -222,7 +222,7 @@
222222
</signal>
223223
<signal name="session_focussed">
224224
<description>
225-
Informs our OpenXR session now has focus, e.g. output is sent to our HMD and we're receiving XR input.
225+
Informs our OpenXR session now has focus, for example output is sent to the HMD and we're receiving XR input.
226226
</description>
227227
</signal>
228228
<signal name="session_loss_pending">
@@ -242,38 +242,38 @@
242242
</signal>
243243
<signal name="session_visible">
244244
<description>
245-
Informs our OpenXR session is now visible, e.g. output is being sent to the HMD but we don't receive XR input.
245+
Informs our OpenXR session is now visible, for example output is sent to the HMD but we don't receive XR input.
246246
</description>
247247
</signal>
248248
</signals>
249249
<constants>
250-
<constant name="OPENXR_SESSION_STATE_UNKNOWN" value="0" enum="OpenXrSessionState">
250+
<constant name="SESSION_STATE_UNKNOWN" value="0" enum="SessionState">
251251
The state of the session is unknown, we haven't tried setting up OpenXR yet.
252252
</constant>
253-
<constant name="OPENXR_SESSION_STATE_IDLE" value="1" enum="OpenXrSessionState">
253+
<constant name="SESSION_STATE_IDLE" value="1" enum="SessionState">
254254
The initial state after the OpenXR session is created or after the session is destroyed.
255255
</constant>
256-
<constant name="OPENXR_SESSION_STATE_READY" value="2" enum="OpenXrSessionState">
256+
<constant name="SESSION_STATE_READY" value="2" enum="SessionState">
257257
OpenXR is ready to begin our session. [signal session_begun] is emitted when we change to this state.
258258
</constant>
259-
<constant name="OPENXR_SESSION_STATE_SYNCHRONIZED" value="3" enum="OpenXrSessionState">
259+
<constant name="SESSION_STATE_SYNCHRONIZED" value="3" enum="SessionState">
260260
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.
261261
</constant>
262-
<constant name="OPENXR_SESSION_STATE_VISIBLE" value="4" enum="OpenXrSessionState">
262+
<constant name="SESSION_STATE_VISIBLE" value="4" enum="SessionState">
263263
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.
264-
[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.
264+
[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.
265265
</constant>
266-
<constant name="OPENXR_SESSION_STATE_FOCUSED" value="5" enum="OpenXrSessionState">
266+
<constant name="SESSION_STATE_FOCUSED" value="5" enum="SessionState">
267267
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.
268268
[b]Note:[/b] This is the state OpenXR will be in when the user can fully interact with your game.
269269
</constant>
270-
<constant name="OPENXR_SESSION_STATE_STOPPING" value="6" enum="OpenXrSessionState">
270+
<constant name="SESSION_STATE_STOPPING" value="6" enum="SessionState">
271271
Our session is being stopped. [signal session_stopping] is emitted when we change to this state.
272272
</constant>
273-
<constant name="OPENXR_SESSION_STATE_LOSS_PENDING" value="7" enum="OpenXrSessionState">
273+
<constant name="SESSION_STATE_LOSS_PENDING" value="7" enum="SessionState">
274274
The session is about to be lost. [signal session_loss_pending] is emitted when we change to this state.
275275
</constant>
276-
<constant name="OPENXR_SESSION_STATE_EXITING" value="8" enum="OpenXrSessionState">
276+
<constant name="SESSION_STATE_EXITING" value="8" enum="SessionState">
277277
The OpenXR instance is about to be destroyed and we're existing. [signal instance_exiting] is emitted when we change to this state.
278278
</constant>
279279
<constant name="HAND_LEFT" value="0" enum="Hand">

modules/openxr/openxr_interface.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ void OpenXRInterface::_bind_methods() {
120120
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");
121121
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "vrs_strength", PROPERTY_HINT_RANGE, "0.1,10.0,0.1"), "set_vrs_strength", "get_vrs_strength");
122122

123-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_UNKNOWN);
124-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_IDLE);
125-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_READY);
126-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_SYNCHRONIZED);
127-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_VISIBLE);
128-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_FOCUSED);
129-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_STOPPING);
130-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_LOSS_PENDING);
131-
BIND_ENUM_CONSTANT(OPENXR_SESSION_STATE_EXITING);
123+
BIND_ENUM_CONSTANT(SESSION_STATE_UNKNOWN);
124+
BIND_ENUM_CONSTANT(SESSION_STATE_IDLE);
125+
BIND_ENUM_CONSTANT(SESSION_STATE_READY);
126+
BIND_ENUM_CONSTANT(SESSION_STATE_SYNCHRONIZED);
127+
BIND_ENUM_CONSTANT(SESSION_STATE_VISIBLE);
128+
BIND_ENUM_CONSTANT(SESSION_STATE_FOCUSED);
129+
BIND_ENUM_CONSTANT(SESSION_STATE_STOPPING);
130+
BIND_ENUM_CONSTANT(SESSION_STATE_LOSS_PENDING);
131+
BIND_ENUM_CONSTANT(SESSION_STATE_EXITING);
132132

133133
BIND_ENUM_CONSTANT(HAND_LEFT);
134134
BIND_ENUM_CONSTANT(HAND_RIGHT);
@@ -1417,12 +1417,12 @@ void OpenXRInterface::on_refresh_rate_changes(float p_new_rate) {
14171417
emit_signal(SNAME("refresh_rate_changed"), p_new_rate);
14181418
}
14191419

1420-
OpenXRInterface::OpenXrSessionState OpenXRInterface::get_session_state() {
1420+
OpenXRInterface::SessionState OpenXRInterface::get_session_state() {
14211421
if (openxr_api) {
1422-
return (OpenXrSessionState)openxr_api->get_session_state();
1422+
return (SessionState)openxr_api->get_session_state();
14231423
}
14241424

1425-
return OPENXR_SESSION_STATE_UNKNOWN;
1425+
return SESSION_STATE_UNKNOWN;
14261426
}
14271427

14281428
/** Hand tracking. */

modules/openxr/openxr_interface.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,19 +218,19 @@ class OpenXRInterface : public XRInterface {
218218
void tracker_profile_changed(RID p_tracker, RID p_interaction_profile);
219219

220220
/** Session */
221-
enum OpenXrSessionState { // Should mirror XrSessionState
222-
OPENXR_SESSION_STATE_UNKNOWN = 0,
223-
OPENXR_SESSION_STATE_IDLE = 1,
224-
OPENXR_SESSION_STATE_READY = 2,
225-
OPENXR_SESSION_STATE_SYNCHRONIZED = 3,
226-
OPENXR_SESSION_STATE_VISIBLE = 4,
227-
OPENXR_SESSION_STATE_FOCUSED = 5,
228-
OPENXR_SESSION_STATE_STOPPING = 6,
229-
OPENXR_SESSION_STATE_LOSS_PENDING = 7,
230-
OPENXR_SESSION_STATE_EXITING = 8,
221+
enum SessionState { // Should mirror XrSessionState
222+
SESSION_STATE_UNKNOWN = 0,
223+
SESSION_STATE_IDLE = 1,
224+
SESSION_STATE_READY = 2,
225+
SESSION_STATE_SYNCHRONIZED = 3,
226+
SESSION_STATE_VISIBLE = 4,
227+
SESSION_STATE_FOCUSED = 5,
228+
SESSION_STATE_STOPPING = 6,
229+
SESSION_STATE_LOSS_PENDING = 7,
230+
SESSION_STATE_EXITING = 8,
231231
};
232232

233-
OpenXrSessionState get_session_state();
233+
SessionState get_session_state();
234234

235235
/** Hand tracking. */
236236
enum Hand {
@@ -337,7 +337,7 @@ class OpenXRInterface : public XRInterface {
337337
~OpenXRInterface();
338338
};
339339

340-
VARIANT_ENUM_CAST(OpenXRInterface::OpenXrSessionState)
340+
VARIANT_ENUM_CAST(OpenXRInterface::SessionState)
341341
VARIANT_ENUM_CAST(OpenXRInterface::Hand)
342342
VARIANT_ENUM_CAST(OpenXRInterface::HandMotionRange)
343343
VARIANT_ENUM_CAST(OpenXRInterface::HandTrackedSource)

0 commit comments

Comments
 (0)