mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
WebVR 1.1 spec compatibility
This commit is contained in:
parent
296a215e54
commit
fe4ee6de2e
16 changed files with 112 additions and 55 deletions
|
@ -192,10 +192,9 @@ found in the LICENSE file.
|
|||
}
|
||||
}
|
||||
|
||||
if (navigator.vr || navigator.getVRDisplays) {
|
||||
if (navigator.getVRDisplays) {
|
||||
frameData = new VRFrameData();
|
||||
navigator.vr.getDisplays().then(function (displays) {
|
||||
// navigator.getVRDisplays().then(function (displays) {
|
||||
navigator.getVRDisplays().then(function (displays) {
|
||||
if (displays.length > 0) {
|
||||
vrDisplay = displays[displays.length - 1];
|
||||
vrDisplay.depthNear = 0.1;
|
||||
|
@ -214,9 +213,9 @@ found in the LICENSE file.
|
|||
if (vrDisplay.capabilities.canPresent)
|
||||
vrPresentButton = VRSamplesUtil.addButton("Enter VR", "E", "media/icons/cardboard64.png", onVRRequestPresent);
|
||||
|
||||
vrDisplay.addEventListener('presentchange', onVRPresentChange, false);
|
||||
//vrDisplay.addEventListener('vrdisplayactivate', onVRRequestPresent, false);
|
||||
//vrDisplay.addEventListener('vrdisplaydeactivate', onVRExitPresent, false);
|
||||
window.addEventListener('vrdisplaypresentchange', onVRPresentChange, false);
|
||||
window.addEventListener('vrdisplayactivate', onVRRequestPresent, false);
|
||||
window.addEventListener('vrdisplaydeactivate', onVRExitPresent, false);
|
||||
console.log(navigator.getGamepads());
|
||||
setTimeout(function(){
|
||||
onVRRequestPresent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue