@Override public void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, int ptr) { gl.vertexAttribPointer(indx, size, type, normalized, stride, ptr); }
@Override public void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, int ptr) { gl.vertexAttribPointer(indx, size, type, normalized, stride, ptr); }
@Override public void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, int ptr) { gl.vertexAttribPointer(indx, size, type, normalized, stride, ptr); } }
@Override public void glVertexAttribPointer (int indx, int size, int type, boolean normalized, int stride, int ptr) { gl.vertexAttribPointer(indx, size, type, normalized, stride, ptr); }
@Override public void glVertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, int ptr) { useNioBuffer &= ~(1 << indx); if (boundArrayBuffer != requestedArrayBuffer) { gl.bindBuffer(GL_ARRAY_BUFFER, requestedArrayBuffer); boundArrayBuffer = requestedArrayBuffer; } gl.vertexAttribPointer(indx, size, type, normalized, stride, ptr); }
@Override public void glVertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, int ptr) { useNioBuffer &= ~(1 << indx); if (boundArrayBuffer != requestedArrayBuffer) { gl.bindBuffer(GL_ARRAY_BUFFER, requestedArrayBuffer); boundArrayBuffer = requestedArrayBuffer; } gl.vertexAttribPointer(indx, size, type, normalized, stride, ptr); }
@Override public void glVertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, int ptr) { useNioBuffer &= ~(1 << indx); if (boundArrayBuffer != requestedArrayBuffer) { gl.bindBuffer(GL_ARRAY_BUFFER, requestedArrayBuffer); boundArrayBuffer = requestedArrayBuffer; } gl.vertexAttribPointer(indx, size, type, normalized, stride, ptr); }
boundArrayBuffer = data.webGlBuffer; gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, data.nioBufferPosition * previousElementSize); } else { gl.bufferData(ARRAY_BUFFER, getTypedArray(data.nioBuffer, data.type, data.nioBufferLimit * elementSize), STREAM_DRAW); gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, data.nioBufferPosition * elementSize); previousNio = data; (data.nioBufferLimit - data.nioBufferPosition) * elementSize), STREAM_DRAW); gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, 0);
boundArrayBuffer = data.webGlBuffer; gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, data.nioBufferPosition * previousElementSize); } else { gl.bufferData(ARRAY_BUFFER, getTypedArray(data.nioBuffer, data.type, data.nioBufferLimit * elementSize), STREAM_DRAW); gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, data.nioBufferPosition * elementSize); previousNio = data; (data.nioBufferLimit - data.nioBufferPosition) * elementSize), STREAM_DRAW); gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, 0);
boundArrayBuffer = data.webGlBuffer; gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, data.nioBufferPosition * previousElementSize); } else { gl.bufferData(ARRAY_BUFFER, getTypedArray(data.nioBuffer, data.type, data.nioBufferLimit * elementSize), STREAM_DRAW); gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, data.nioBufferPosition * elementSize); previousNio = data; (data.nioBufferLimit - data.nioBufferPosition) * elementSize), STREAM_DRAW); gl.vertexAttribPointer(i, data.size, data.type, data.normalize, data.stride, 0);
private void drawQuad() { // Use the sole shader program. gl.useProgram(shaderProgram); // Projection matrix. WebGLUniformLocation pUniform = gl.getUniformLocation(shaderProgram, "projectionMatrix"); gl.uniformMatrix4fv(pUniform, false, projectionMatrix); // Model View matrix. WebGLUniformLocation mvUniform = gl.getUniformLocation(shaderProgram, "modelViewMatrix"); gl.uniformMatrix4fv(mvUniform, false, modelViewMatrix); // Bird texture. gl.activeTexture(TEXTURE0); gl.uniform1i(gl.getUniformLocation(shaderProgram, "texture"), 0); // Vertices (position, texCoord) gl.bindBuffer(ARRAY_BUFFER, buffer); int vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "vertexPosition"); gl.vertexAttribPointer(vertexPositionAttribute, 3, FLOAT, false, 0, 0); gl.enableVertexAttribArray(vertexPositionAttribute); int texCoordAttribute = gl.getAttribLocation(shaderProgram, "texCoord"); gl.vertexAttribPointer(texCoordAttribute, 2, FLOAT, false, 0, 12 * Float32Array.BYTES_PER_ELEMENT); gl.enableVertexAttribArray(texCoordAttribute); // Elements. gl.bindBuffer(ELEMENT_ARRAY_BUFFER, indexBuffer); gl.drawArrays(TRIANGLE_STRIP, 0, 4); }
private void drawQuad() { // Use the sole shader program. gl.useProgram(shaderProgram); // Projection matrix. WebGLUniformLocation pUniform = gl.getUniformLocation(shaderProgram, "projectionMatrix"); gl.uniformMatrix4fv(pUniform, false, projectionMatrix); // Model View matrix. WebGLUniformLocation mvUniform = gl.getUniformLocation(shaderProgram, "modelViewMatrix"); gl.uniformMatrix4fv(mvUniform, false, modelViewMatrix); // Bird texture. gl.activeTexture(TEXTURE0); gl.uniform1i(gl.getUniformLocation(shaderProgram, "texture"), 0); // Vertices (position, texCoord) gl.bindBuffer(ARRAY_BUFFER, buffer); int vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "vertexPosition"); gl.vertexAttribPointer(vertexPositionAttribute, 3, FLOAT, false, 0, 0); gl.enableVertexAttribArray(vertexPositionAttribute); int texCoordAttribute = gl.getAttribLocation(shaderProgram, "texCoord"); gl.vertexAttribPointer(texCoordAttribute, 2, FLOAT, false, 0, 12 * Float32Array.BYTES_PER_ELEMENT); gl.enableVertexAttribArray(texCoordAttribute); // Elements. gl.bindBuffer(ELEMENT_ARRAY_BUFFER, indexBuffer); gl.drawArrays(TRIANGLE_STRIP, 0, 4); }
private void drawQuad() { // Use the sole shader program. gl.useProgram(shaderProgram); // Projection matrix. WebGLUniformLocation pUniform = gl.getUniformLocation(shaderProgram, "projectionMatrix"); gl.uniformMatrix4fv(pUniform, false, projectionMatrix); // Model View matrix. WebGLUniformLocation mvUniform = gl.getUniformLocation(shaderProgram, "modelViewMatrix"); gl.uniformMatrix4fv(mvUniform, false, modelViewMatrix); // Bird texture. gl.activeTexture(TEXTURE0); gl.uniform1i(gl.getUniformLocation(shaderProgram, "texture"), 0); // Vertices (position, texCoord) gl.bindBuffer(ARRAY_BUFFER, buffer); int vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "vertexPosition"); gl.vertexAttribPointer(vertexPositionAttribute, 3, FLOAT, false, 0, 0); gl.enableVertexAttribArray(vertexPositionAttribute); int texCoordAttribute = gl.getAttribLocation(shaderProgram, "texCoord"); gl.vertexAttribPointer(texCoordAttribute, 2, FLOAT, false, 0, 12 * Float32Array.BYTES_PER_ELEMENT); gl.enableVertexAttribArray(texCoordAttribute); // Elements. gl.bindBuffer(ELEMENT_ARRAY_BUFFER, indexBuffer); gl.drawArrays(TRIANGLE_STRIP, 0, 4); }