diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/openxr/extensions/openxr_opengl_extension.cpp | 13 | ||||
-rw-r--r-- | modules/openxr/openxr_interface.cpp | 2 |
2 files changed, 2 insertions, 13 deletions
diff --git a/modules/openxr/extensions/openxr_opengl_extension.cpp b/modules/openxr/extensions/openxr_opengl_extension.cpp index a25727f885..ee69144123 100644 --- a/modules/openxr/extensions/openxr_opengl_extension.cpp +++ b/modules/openxr/extensions/openxr_opengl_extension.cpp @@ -151,19 +151,6 @@ void *OpenXROpenGLExtension::set_session_create_and_get_next_pointer(void *p_nex graphics_binding_gl.glxContext = (GLXContext)glxcontext_handle; graphics_binding_gl.glxDrawable = (GLXDrawable)glxdrawable_handle; - if (graphics_binding_gl.xDisplay == nullptr) { - print_line("OpenXR Failed to get xDisplay from Godot, using XOpenDisplay(nullptr)"); - graphics_binding_gl.xDisplay = XOpenDisplay(nullptr); - } - if (graphics_binding_gl.glxContext == nullptr) { - print_line("OpenXR Failed to get glxContext from Godot, using glXGetCurrentContext()"); - graphics_binding_gl.glxContext = glXGetCurrentContext(); - } - if (graphics_binding_gl.glxDrawable == 0) { - print_line("OpenXR Failed to get glxDrawable from Godot, using glXGetCurrentDrawable()"); - graphics_binding_gl.glxDrawable = glXGetCurrentDrawable(); - } - // spec says to use proper values but runtimes don't care graphics_binding_gl.visualid = 0; graphics_binding_gl.glxFBConfig = 0; diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index be6b7e4411..1db8f5e665 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -666,6 +666,7 @@ Transform3D OpenXRInterface::get_camera_transform() { Transform3D OpenXRInterface::get_transform_for_view(uint32_t p_view, const Transform3D &p_cam_transform) { XRServer *xr_server = XRServer::get_singleton(); ERR_FAIL_NULL_V(xr_server, Transform3D()); + ERR_FAIL_INDEX_V_MSG(p_view, get_view_count(), Transform3D(), "View index outside bounds."); Transform3D t; if (openxr_api && openxr_api->get_view_transform(p_view, t)) { @@ -685,6 +686,7 @@ Transform3D OpenXRInterface::get_transform_for_view(uint32_t p_view, const Trans Projection OpenXRInterface::get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) { Projection cm; + ERR_FAIL_INDEX_V_MSG(p_view, get_view_count(), cm, "View index outside bounds."); if (openxr_api) { if (openxr_api->get_view_projection(p_view, p_z_near, p_z_far, cm)) { |