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 Rémi Verschelde
parent 99d66b4b22
commit 15603b20db

View File

@ -51,6 +51,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));