Closed haxiomic closed 9 years ago
The right place to check for the correct behaviour is the WebGL spec
The return value is null if name does not correspond to an active uniform variable in the passed program. Returns null if name starts with one of the reserved WebGL prefixes per GLSL Constructs. Returns null if any OpenGL errors are generated during the execution of this function.
But keep this issue open, I'll take a look at matching the spec on native in the best way for the future changes (native stuff)
On web, null is returned if getUniformLocation fails, whereas on native, -1 is returned, consequently there's no platform independent way to check if a GLUniformLocation is valid.
I've been using this abstract in native/render/opengl/GL.hx (newtypedarray branch) that treats GLUniformLocation as a Null checks if its value is -1 when comparing with null
I suspect it's not bullet proof but do you think this is the right approach?