Skip to content

Commit

Permalink
WebXR: Update for Emscripten 3.1.71 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnopek committed Dec 17, 2024
1 parent b9437c3 commit 9c288ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes strict_checks=yes
EM_VERSION: 3.1.64
EM_VERSION: 3.1.74

concurrency:
group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}-web
Expand Down
10 changes: 5 additions & 5 deletions modules/webxr/native/library_godot_webxr.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**************************************************************************/

const GodotWebXR = {
$GodotWebXR__deps: ['$Browser', '$GL', '$GodotRuntime', '$runtimeKeepalivePush', '$runtimeKeepalivePop'],
$GodotWebXR__deps: ['$MainLoop', '$GL', '$GodotRuntime', '$runtimeKeepalivePush', '$runtimeKeepalivePop'],
$GodotWebXR: {
gl: null,

Expand Down Expand Up @@ -64,9 +64,9 @@ const GodotWebXR = {
},
monkeyPatchRequestAnimationFrame: (enable) => {
if (GodotWebXR.orig_requestAnimationFrame === null) {
GodotWebXR.orig_requestAnimationFrame = Browser.requestAnimationFrame;
GodotWebXR.orig_requestAnimationFrame = MainLoop.requestAnimationFrame;
}
Browser.requestAnimationFrame = enable
MainLoop.requestAnimationFrame = enable
? GodotWebXR.requestAnimationFrame
: GodotWebXR.orig_requestAnimationFrame;
},
Expand All @@ -76,11 +76,11 @@ const GodotWebXR = {
// enabled or disabled. When using the WebXR API Emulator, this
// gets picked up automatically, however, in the Oculus Browser
// on the Quest, we need to pause and resume the main loop.
Browser.mainLoop.pause();
MainLoop.pause();
runtimeKeepalivePush();
window.setTimeout(function () {
runtimeKeepalivePop();
Browser.mainLoop.resume();
MainLoop.resume();
}, 0);
},

Expand Down
1 change: 1 addition & 0 deletions platform/web/eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const emscriptenGlobals = {
'HEAPU8': true,
'IDBFS': true,
'LibraryManager': true,
'MainLoop': true,
'Module': true,
'UTF8ToString': true,
'_emscripten_webgl_get_current_context': true,
Expand Down

0 comments on commit 9c288ef

Please sign in to comment.