On 1/26/2010 1:04 PM, Vangelis Kokkevis wrote:
One thing that I have on my todo list (it's actually done, just need to make sure I don't screw up the svn line endings) is to change the webgl attributes object a bit -- we changed 'antialias' to 'antialiasHint', and made the other non-Hint attributes requirements... that is, if you request stencil, you either get a context with a stencil buffer, or null. For the Hint attributes, you can get anything, but you indicate your preference.
One thing that I didn't do here but might be a good idea is to move getContextAttributes(contextId) to the canvas itself, as opposed to putting it on the context. That seems to be better symmetry.
It would be simpler, but the latter bit is exactly what worries me -- if the attributes are just silently ignored, then the user might think that a switch took place.
What about a third alternative: attributes are invalid on a getContext() call for an already-active context? That is, any subsequent getContext call must not specify any attributes?