createBufferFromBufferAttribute method
Buffer
createBufferFromBufferAttribute(
- OpenGLContextES gl,
- BufferAttribute bufferAttribute,
- int drawType
The drawType
can be:
- ARRAY_BUFFER
- gl.ELEMENT_ARRAY_BUFFER
Info about the buffer
Basicaly a buffer is an array.
Implementation
Buffer createBufferFromBufferAttribute(OpenGLContextES gl, BufferAttribute bufferAttribute, int drawType) {
Buffer buffer = gl.createBuffer();
gl.bindBuffer(drawType, buffer);
gl.bufferData(drawType, bufferAttribute.array, gl.STATIC_DRAW);
return buffer;
}