[Public WebGL] Oversight in bufferData and bufferSubData specification

Cedric Vivier [email protected]
Mon May 23 12:53:26 PDT 2011


On Tue, May 24, 2011 at 02:20, Gregg Tavares (wrk) <[email protected]> wrote:
> gl.bufferData(gl.ARRAY_BUFFER, asDoubles, ..);  // uploads all 96 bytes of
> mixed data
> Disallowing the last line doesn't give us one iota of type safety so why
> specifically disallow it?

Imho Kenneth's idea is not about type safety, _we can always cast_,
this is about having better reporting for simple errors/types by
better expressing the intent of the data you send to GL.

Consider a much simpler example :

readModelInto(float64ArrayThatHasBeenCreatedElsewhere); //this fills
the values of any passed TypedArray from another source eg. a JSON
array.
gl.bufferData(gl.ARRAY_BUFFER, float64ArrayThatHasBeenCreatedElsewhere);


This will result in unintended/unexpected results that the developer
might have hard time to track down as there is absolutely no
warning/error given to something that is semantically wrong.

Regards,

-----------------------------------------------------------
You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------




More information about the public_webgl mailing list