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

Re: [Public WebGL] gl.sizeInBytes

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 <vladimir@mozilla.com> 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