private void bindAttribsBufs () { gl.glBindBuffer(GL_ARRAY_BUFFER, verticesId); // bind our stable vertex attributes int stride = vertexStride(); glBindVertAttrib(aMatrix, 4, GL_FLOAT, stride, 0); glBindVertAttrib(aTranslation, 2, GL_FLOAT, stride, 16); glBindVertAttrib(aColor, 2, GL_FLOAT, stride, 24); // bind our changing vertex attributes int offset = stableAttrsSize()*FLOAT_SIZE_BYTES; glBindVertAttrib(aPosition, 2, GL_FLOAT, stride, offset); glBindVertAttrib(aTexCoord, 2, GL_FLOAT, stride, offset+8); gl.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementsId); gl.glActiveTexture(GL_TEXTURE0); gl.glUniform1i(uTexture, 0); }
private void bindAttribsBufs () { gl.glBindBuffer(GL_ARRAY_BUFFER, verticesId); // bind our stable vertex attributes int stride = vertexStride(); glBindVertAttrib(aMatrix, 4, GL_FLOAT, stride, 0); glBindVertAttrib(aTranslation, 2, GL_FLOAT, stride, 16); glBindVertAttrib(aColor, 2, GL_FLOAT, stride, 24); // bind our changing vertex attributes int offset = stableAttrsSize()*FLOAT_SIZE_BYTES; glBindVertAttrib(aPosition, 2, GL_FLOAT, stride, offset); glBindVertAttrib(aTexCoord, 2, GL_FLOAT, stride, offset+8); gl.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementsId); gl.glActiveTexture(GL_TEXTURE0); gl.glUniform1i(uTexture, 0); }