From 3ac4c02dfa8cb290912cbc01cae3fbf762c0781c Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Fri, 2 Jul 2021 10:41:59 -0400 Subject: [PATCH] fix(SkyboxViewer): fix errors in the SkyboxViewer Update getOpenGLRenderWindow to getAPISpecificRenderWindow Make sure requestAnimation has a requestor as now required --- Examples/Applications/SkyboxViewer/index.js | 8 ++++---- .../Interaction/Misc/DeviceOrientationToCamera/index.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Examples/Applications/SkyboxViewer/index.js b/Examples/Applications/SkyboxViewer/index.js index 5bd234fa414..c8c6d19c5b4 100644 --- a/Examples/Applications/SkyboxViewer/index.js +++ b/Examples/Applications/SkyboxViewer/index.js @@ -236,7 +236,7 @@ function createVisualization(container, mapReader) { distPass.setCameraCenterX1(-eyeSpacing); distPass.setCameraCenterX2(eyeSpacing); distPass.setDelegates([vtkForwardPass.newInstance()]); - fullScreenRenderer.getOpenGLRenderWindow().setRenderPasses([distPass]); + fullScreenRenderer.getAPISpecificRenderWindow().setRenderPasses([distPass]); // Hide any controller fullScreenRenderer.setControllerVisibility(false); @@ -278,10 +278,10 @@ function createVisualization(container, mapReader) { mainRenderer.addActor(actor); // add vr option button if supported - fullScreenRenderer.getOpenGLRenderWindow().onHaveVRDisplay(() => { + fullScreenRenderer.getApiSpecificRenderWindow().onHaveVRDisplay(() => { if ( - fullScreenRenderer.getOpenGLRenderWindow().getVrDisplay().capabilities - .canPresent + fullScreenRenderer.getApiSpecificRenderWindow().getVrDisplay() + .capabilities.canPresent ) { const button = document.createElement('button'); button.style.position = 'absolute'; diff --git a/Sources/Interaction/Misc/DeviceOrientationToCamera/index.js b/Sources/Interaction/Misc/DeviceOrientationToCamera/index.js index 8a1c28ecf7a..5574b6adb8e 100644 --- a/Sources/Interaction/Misc/DeviceOrientationToCamera/index.js +++ b/Sources/Interaction/Misc/DeviceOrientationToCamera/index.js @@ -89,7 +89,7 @@ function addCameraToSynchronize( listeners.push(listener); if (orientation.update) { - listener.renderWindowInteractor.requestAnimation(); + listener.renderWindowInteractor.requestAnimation(listener); } return listenerId; @@ -100,7 +100,7 @@ function removeCameraToSynchronize(id, cancelAnimation = true) { if (listener) { listener.subscription.unsubscribe(); if (cancelAnimation) { - listener.renderWindowInteractor.cancelAnimation(); + listener.renderWindowInteractor.cancelAnimation(listener); } } listeners[id] = null;