summaryrefslogtreecommitdiffstats
path: root/modules/webxr/native
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-06-26 21:40:07 -0500
committerDavid Snopek <dsnopek@gmail.com>2024-06-26 22:02:20 -0500
commit2f001e6789ba6bfadd1ebe5f7478a93690279d92 (patch)
tree3ac72e7be23a3df072185433b8e8dfc277eecf9e /modules/webxr/native
parent374807f427eec5ee7caebfc509a158fe715a6bfe (diff)
downloadredot-engine-2f001e6789ba6bfadd1ebe5f7478a93690279d92.tar.gz
Fix support for environment blend modes on `WebXRInterface`
Diffstat (limited to 'modules/webxr/native')
-rw-r--r--modules/webxr/native/library_godot_webxr.js5
-rw-r--r--modules/webxr/native/webxr.externs.js5
2 files changed, 9 insertions, 1 deletions
diff --git a/modules/webxr/native/library_godot_webxr.js b/modules/webxr/native/library_godot_webxr.js
index 581da4d56f..155409f931 100644
--- a/modules/webxr/native/library_godot_webxr.js
+++ b/modules/webxr/native/library_godot_webxr.js
@@ -322,9 +322,12 @@ const GodotWebXR = {
const reference_space_c_str = GodotRuntime.allocString(reference_space_type);
const enabled_features = 'enabledFeatures' in session ? Array.from(session.enabledFeatures) : [];
const enabled_features_c_str = GodotRuntime.allocString(enabled_features.join(','));
- onstarted(reference_space_c_str, enabled_features_c_str);
+ const environment_blend_mode = 'environmentBlendMode' in session ? session.environmentBlendMode : '';
+ const environment_blend_mode_c_str = GodotRuntime.allocString(environment_blend_mode);
+ onstarted(reference_space_c_str, enabled_features_c_str, environment_blend_mode_c_str);
GodotRuntime.free(reference_space_c_str);
GodotRuntime.free(enabled_features_c_str);
+ GodotRuntime.free(environment_blend_mode_c_str);
}, 0);
}
diff --git a/modules/webxr/native/webxr.externs.js b/modules/webxr/native/webxr.externs.js
index 80a7f8d2de..18125d7869 100644
--- a/modules/webxr/native/webxr.externs.js
+++ b/modules/webxr/native/webxr.externs.js
@@ -83,6 +83,11 @@ XRSession.prototype.supportedFrameRates;
XRSession.prototype.enabledFeatures;
/**
+ * @type {string}
+ */
+XRSession.prototype.environmentBlendMode;
+
+/**
* @type {?function (Event)}
*/
XRSession.prototype.onend;