-
Notifications
You must be signed in to change notification settings - Fork 159
Closed
Description
Unfortunately, while Firefox, IE, Edge, Chrome and Opera allow access to the GLenum constants on the WebGLRenderingContext constructor directly, this does not work on Safari (iOS or Desktop).
This leaves two options:
- Move the constants defined in
object WebGLRenderingContextontoclass WebGLRenderingContext, which works, but personally I find pulling constants out of instance objects weird (especially since you might want to initialize a data structure with a GL constant before context initialization), or - Make
object WebGLRenderingContexta non-native object containing the literals asfinal val(which are the same across all browsers, and the C OpenGL apis where applicable) - This is confirmed to work in principle, since I have a library that does this which I've been using well for several months, and I only now just noticed this issue when migrating to purescala-js-dom. I prefer this solution, which appears to work, although it's tedious and error prone so some care must be taken (though I have what I believe to be a fairly correct implementation of such an object already, modulo some WebGL specific constants).
Metadata
Metadata
Assignees
Labels
No labels