[Public WebGL] Null return values from create*

Glenn Maynard [email protected]
Wed Apr 4 20:13:23 PDT 2012

On Wed, Apr 4, 2012 at 9:18 PM, Gregg Tavares (勤) <[email protected]> wrote:

> Where are all the places one would return these invalid objects?
> createProgram,
> createShader,
> createTexture,
> createBuffer,
> createRenderbuffer
> createFramebuffer,
> getUniformLocation?
> getActiveAttrib
> getActiveUniform
> getUniformLocation seems a little weird in that passing it a uniform that
> does not exist returns NULL but passing it a uniform after context lost
> returns an invalid location? Or still NULL?

We're only really talking about functions that return WebGLObject
subclasses, since those are the ones that have an invalidated flag to use
instead of a null return value.  WebGLUniformLocation and WebGLActiveInfo
don't have an invalidated state, since it's not a WebGLObject.  I'd look at
these later, if we start looking at reducing other null return values.

> how about getParameter?

getParameter is hard, since there are a lot of possible arguments with
varying reasonable "placeholder" results.  I'd defer this, too.

While I'm thinking about it: does getParameter() define that values like
MAX_VIEWPORT_DIMS and VIEWPORT always return a new object, as opposed to
returning the same object each time?

Glenn Maynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20120404/fc61ea8c/attachment.html>

More information about the public_webgl mailing list