From 3963a11b2fe8232a4000ea06727dee6a7f69b8b9 Mon Sep 17 00:00:00 2001 From: David Snopek Date: Sat, 17 Jul 2021 14:55:19 -0500 Subject: Re-enable building WebXR in GitHub Actions --- modules/webxr/webxr_interface_js.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'modules/webxr/webxr_interface_js.cpp') diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 01cc05aa0b..afe69ba172 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -35,6 +35,7 @@ #include "core/os/os.h" #include "emscripten.h" #include "godot_webxr.h" +#include "servers/rendering/renderer_compositor.h" #include void _emwebxr_on_session_supported(char *p_session_mode, int p_supported) { @@ -376,6 +377,22 @@ void WebXRInterfaceJS::commit_for_eye(XRInterface::Eyes p_eye, RID p_render_targ return; } godot_webxr_commit_for_eye(p_eye); +} + +Vector WebXRInterfaceJS::commit_views(RID p_render_target, const Rect2 &p_screen_rect) { + Vector blit_to_screen; + + if (!initialized) { + return blit_to_screen; + } + + // @todo Refactor this to be based on "views" rather than "eyes". + godot_webxr_commit_for_eye(XRInterface::EYE_LEFT); + if (godot_webxr_get_view_count() > 1) { + godot_webxr_commit_for_eye(XRInterface::EYE_RIGHT); + } + + return blit_to_screen; }; void WebXRInterfaceJS::process() { -- cgit v1.2.3