Skip to content

Commit ba942a8

Browse files
committed
fix(vtkOpenGLRenderWindow): Remove unused HaveVRDisplay event
Removes `vtkOpenGLRenderWindow.HaveVRDisplay` event. This event is unused internally and was previously left over from WebVR to WebXR integration to avoid API breakage. Under previous behavior the `navigator.xr` check was called eagerly at construction, which could result in an unhandled exception. This change removes that eager check so that `navigator.xr` is referenced only if an XR-related method such as `startXR` is called. Applications should query `navigator.xr` directly to determine whether a given session type may be supported. Resolves #2537
1 parent 2cedd52 commit ba942a8

File tree

1 file changed

+0
-11
lines changed
  • Sources/Rendering/OpenGL/RenderWindow

1 file changed

+0
-11
lines changed

Sources/Rendering/OpenGL/RenderWindow/index.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
107107
false
108108
);
109109

110-
// Cache the value here as calling it on each frame is expensive
111-
const isImmersiveVrSupported =
112-
navigator.xr !== undefined &&
113-
navigator.xr.isSessionSupported('immersive-vr');
114-
115110
// Auto update style
116111
const previousSize = [0, 0];
117112
function updateWindow() {
@@ -263,11 +258,6 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
263258
) => {
264259
let result = null;
265260

266-
// Do we have webxr support
267-
if (isImmersiveVrSupported) {
268-
publicAPI.invokeHaveVRDisplay();
269-
}
270-
271261
const webgl2Supported = typeof WebGL2RenderingContext !== 'undefined';
272262
model.webgl2 = false;
273263
if (model.defaultToWebgl2 && webgl2Supported) {
@@ -1367,7 +1357,6 @@ export function extend(publicAPI, model, initialValues = {}) {
13671357
model.renderPasses[0] = vtkForwardPass.newInstance();
13681358

13691359
macro.event(publicAPI, model, 'imageReady');
1370-
macro.event(publicAPI, model, 'haveVRDisplay');
13711360

13721361
// Build VTK API
13731362
macro.get(publicAPI, model, [

0 commit comments

Comments
 (0)