List of usage examples for com.google.gwt.typedarrays.client Float32Array getByteLength
public final native int getByteLength() ;
From source file:com.googlecode.gwtgl.example.client.examples.skybox.SkyboxExample.java
License:Apache License
/** * Initializes the buffers for vertex coordinates, normals and texture * coordinates./* w ww. j a v a 2 s . co m*/ */ private void initBuffers() { buffer = glContext.createBuffer(); glContext.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, buffer); Float32Array vertices = Float32Array.create(cube.getVertices()); texCoordsOffset = vertices.getByteLength(); Float32Array texCoords = Float32Array.create(cube.getTexCoords()); glContext.bufferData(WebGLRenderingContext.ARRAY_BUFFER, vertices.getByteLength() + texCoords.getByteLength(), WebGLRenderingContext.STATIC_DRAW); glContext.bufferSubData(WebGLRenderingContext.ARRAY_BUFFER, 0, vertices); glContext.bufferSubData(WebGLRenderingContext.ARRAY_BUFFER, texCoordsOffset, texCoords); checkErrors(); }