Merge pull request #68488 from dsnopek/master-webxr-no-exit-runtime

Fix WebXR after changing Emscripten configuration noExitRuntime to false
This commit is contained in:
Fabio Alessandrelli 2022-11-14 21:31:58 +01:00 committed by GitHub
commit aa4c286808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
const GodotWebXR = {
$GodotWebXR__deps: ['$Browser', '$GL', '$GodotRuntime'],
$GodotWebXR__deps: ['$Browser', '$GL', '$GodotRuntime', '$runtimeKeepalivePush', '$runtimeKeepalivePop'],
$GodotWebXR: {
gl: null,
@ -69,7 +69,9 @@ const GodotWebXR = {
// gets picked up automatically, however, in the Oculus Browser
// on the Quest, we need to pause and resume the main loop.
Browser.mainLoop.pause();
runtimeKeepalivePush(); // eslint-disable-line no-undef
window.setTimeout(function () {
runtimeKeepalivePop(); // eslint-disable-line no-undef
Browser.mainLoop.resume();
}, 0);
},