[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Null return values on context loss

On Wed, Nov 16, 2011 at 05:11, Glenn Maynard <glenn@zewt.org> wrote:
> Returning a placeholder value on error (zero, false, arrays filled with
> zeroes, and so on) rather than null would make user code more likely to
> tolerate it until it can receive the webglcontextlost event, and you could
> check whether a return value is an error by calling isContextLost at the end
> of an operation. Defining error case returns for everything would be a lot
> of surface area in the spec, though, and it sort of turns error values into
> a bunch of special cases.

The "placeholder value" could be ES 2.0's initial value [1] ?
It would avoid adding too much text to the spec, while returning
sensible 'defaults' that should not break apps.

getContextAttributes should probably work regardless of context loss
(the context attributes are always available to the implementation).
getSupportedExtensions should return an empty array as if no extension
is supported.

Methods returning a string - get(Program|Shader)InfoLog - should
return an empty string rather than null.
This also make it match ES 2.0 actually : "The information log for a
program object is either **an empty string**, or a string containing
information about the last link operation, or a string containing
information about the last validation operation."

[1] : eg. for http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetVertexAttrib.xml
and http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetTexParameter.xml

You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl