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

Re: [Public WebGL] getContext error handling

On Sat, Apr 9, 2011 at 10:17 PM, Cedric Vivier <cedricv@neonux.com> wrote:
Nice, this makes even more sense to describe it here indeed.
We should take this opportunity to define all WebGL events as simple
events as well.

That's how the newer specs handle these events: they're described as steps in the algorithms they're generated by, instead of described on their own. IMO, this makes things much clearer.

> The "clear the primary context" part in step 2 shouldn't be necessary; the
> getContext algorithm in the HTML should specify this.

I think it is indeed unnecessary and already specified at [1].
WebGL's getContext behavior described above would be the step 6 of
canvas's getContext [1], therefore according to step 3 of [1] it is
not possible to get to WebGL's getContext when there is already a
primary context.

The problem is when null is returned--it should be possible to try again. Currently per spec, if getContext returns null once, step 5 will always return null.

FYI, I still think getContext should throw an error if an error happens. Using a message like this is unusual. There's no provision in the HTML getContext spec for this, though. I'll go ask on whatwg.

However this might make sense to require for null rather than an
exception with any context when an error occurred at creation.

Sorry, I don't understand.

Glenn Maynard