Fix bug with OpenXR composition layers added after OpenXR is running

(cherry picked from commit e2386de505)
This commit is contained in:
David Snopek
2024-10-23 14:30:56 -05:00
committed by Spartan322
parent 67d9c2af4a
commit a150eee70d

View File

@@ -53,6 +53,10 @@ OpenXRCompositionLayer::OpenXRCompositionLayer() {
openxr_api = OpenXRAPI::get_singleton();
composition_layer_extension = OpenXRCompositionLayerExtension::get_singleton();
if (openxr_api) {
openxr_session_running = openxr_api->is_running();
}
Ref<OpenXRInterface> openxr_interface = XRServer::get_singleton()->find_interface("OpenXR");
if (openxr_interface.is_valid()) {
openxr_interface->connect("session_begun", callable_mp(this, &OpenXRCompositionLayer::_on_openxr_session_begun));