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

Re: [Public WebGL] Should WebGLContextAttributes be a callback interface?

Kenneth Russell:
Sorry about that. It looks like I did drop that set of changes on the
floor by accident. Let's resolve this issue now.

Has there been a decision on the best path forward here? The
requirements in the WebGL spec are relatively small; it must be
possible to pass a user object to getContext("webgl", /* attrs */) and
it must be possible to define the attributes and their types returned
from getContextAttributes. Aside from that the existence of the
WebGLContextAttributes interface is not important.

Another problem is that a callback interface can't be used as the return type of getContextAttributes(). (It seems Web IDL doesn't explicitly disallow this, but it should.)

Am I right in thinking that assigning to the properties of the object returned from getContextAttributes() shouldn't affect the context? In that case, I think we can just change WebGLContextAttributes to a dictionary, and that lets us put the defaults on the dictionary too to avoid mentioning them in prose:

  dictionary WebGLContextAttributes {
    boolean alpha = true;
    boolean depth = true;
    boolean stencil = false;
    boolean antialias = true;
    boolean premultipliedAlpha = true;
    boolean preserveDrawingBuffer = false;

getContextAttributes() will then return a new JS object with those six properties set on it.

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