immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
386 stars 86 forks source link

Also extend WebGL2RenderingContext #21

Closed Squareys closed 6 years ago

Squareys commented 6 years ago

Hi @toji !

I'm using WebXR with WebGL2 and it seems that Firefox is unable to find setCompatibleXRDevice(...) on a WebGL2 rendering context, if it is not explicitly extended also.

Cheers, Jonathan.

Squareys commented 6 years ago

I saw travis failing, will check what's going on later this week and fix it :)

jsantell commented 6 years ago

I'll take a look later today, but I didn't think WebGL2RenderingContext was supported in any WebVR case

toji commented 6 years ago

It was, and it should be supported for the Cardboard polyfill as well.

And for what it's worth I tried to figure out the Travis CI issue over the weekend and came up empty handed. I have no idea what's causing that error. Any thoughts, Jordan?

jsantell commented 6 years ago

Error: Global must have the following attributes : navigator,HTMLCanvasElement,WebGLRenderingContext,WebGL2RenderingContext

A dummy WebGL2RenderingContext needs to be added to ./test/lib/globals.js as the tests run in node where GL doesn't really exist -- non-ideal but works for now!

Squareys commented 6 years ago

Done, thanks @jsantell !

jsantell commented 6 years ago

Looks good to me, thanks @Squareys!