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

Re: [Public WebGL] WebGL bufferSubData lacks "size" parameter

You need
var buf2 = new Uint8Array(buf.buffer, 20, 40);

buf is a TypedArray, buf.buffer is an ArrayBuffer.


On Jan 11, 2012 12:49 PM, "Chananya Freiman" <spectralcanine@gmail.com> wrote:
Creating a second view like you showed doesn't work, it copies the whole buffer.
Try the following code:

var buf = new Uint8Array(100);
var buf2 = new Uint8Array(buf, 20, 40);

It might work if I use actual ArrayBuffers, but for that I will have to change my whole code.