-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moves canvas initialization logic from a component to the scene. This… #2985
Conversation
tests/core/scene/a-scene.test.js
Outdated
@@ -385,7 +385,7 @@ suite('a-scene (without renderer)', function () { | |||
var sceneEl = this.el; | |||
sceneEl.innerHTML = 'NEW'; | |||
sceneEl.reload(); | |||
assert.equal(sceneEl.innerHTML, ''); | |||
assert.equal(sceneEl.innerHTML, '<canvas class="a-canvas" data-aframe-canvas="true"></canvas>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do a more robust test with query selector rather than string check.
src/core/scene/a-scene.js
Outdated
@@ -449,6 +450,46 @@ module.exports.AScene = registerElement('a-scene', { | |||
writable: window.debug | |||
}, | |||
|
|||
setupCanvas: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move this out of the prototype to pure function. setupCanvas (sceneEl)
.
src/core/scene/a-scene.js
Outdated
// Set canvas on scene. | ||
sceneEl.canvas = canvasEl; | ||
sceneEl.emit('render-target-loaded', {target: canvasEl}); | ||
// For unknown reasons a syncrhonous resize does not work on desktop when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can fix this typo on synchronous
r+wc |
FYI - this does not solve #2967 |
Yes, the |
… handle the case when calling enterVR before the renderer is initialized and also moves the canvas and renderer initialization before assets load (it's not a component anymore). This is a prequesite for a loading screen / spinner
…traversal in Oculus Browser) (#2991) * Moves canvas initialization logic from a component to the scene. This handle the case when calling enterVR before the renderer is initialized and also moves the canvas and renderer initialization before assets load (it's not a component anymore). This is a prequesite for a loading screen / spinner * add vrdisplayactivate handler earlier than previously, as Oculus Browser fires it quite early on * remove redundant vrdisplayactivate listener in a-scene; improve comments
…(vr2vr traversal in Oculus Browser)" (#2995) * Revert "Update master CDN URL. (https://rawgit.com/aframevr/aframe/fad376f/dist/aframe-master.min.js)" This reverts commit d576691. * Revert "Bump aframe-master dist/ builds. (c9c7bfc...5214a16)" This reverts commit fad376f. * Revert "extend PR #2985 (moved canvas init) to also solve issue #2967 (vr2vr traversal in Oculus Browser) (#2991)" This reverts commit 5214a16.
… handle the case when calling enterVR before the renderer is initialized and also moves the canvas and renderer initialization before assets load (it's not a component anymore). This is a prequesite for a loading screen / spinner
Description:
Changes proposed: