[Public WebGL] gl.sizeInBytes

Patrick Baggett [email protected]
Sun Jan 10 12:56:37 PST 2010


Thanks for the fast response!
The comment in the recently added example should be removed as it would be
misleading:

// Round up to sizeInBytes(gl.FLOAT) -- just in case it isn't 4 on
some platforms

I think gl.[Type]_SIZE makes more sense than a function, my two cents.

Patrick Baggett

On Sun, Jan 10, 2010 at 2:44 PM, Vladimir Vukicevic <[email protected]>wrote:

>
> sizeInBytes is intended to be a convenience function, so that you can write
> 100 * gl.sizeInBytes(gl.FLOAT) instead of having a magic "4" there.  It will
> always return the same size values that are listed in 5.13.3.  But I do
> think that we can do without it; if anything, we could just define constants
> on the gl object, e.g. gl.FLOAT_SIZE, or perhaps
> WebGLFloatArray.ELEMENT_SIZE or something (though the latter is pretty
> wordy).
>
>    - Vlad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20100110/2231ecb0/attachment.html>


More information about the public_webgl mailing list