Created
July 18, 2016 21:53
-
-
Save busti/5fddce4b52930efa8704c9d53032e211 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void draw(final int programHandle) { | |
final int positionHandle = GLES20.glGetAttribLocation(programHandle, "vertPos"); | |
final int colorHandle = GLES20.glGetUniformLocation(programHandle, "vertColor"); | |
GLES20.glEnableVertexAttribArray(positionHandle); | |
GLES20.glVertexAttribPointer(positionHandle, 3, GLES20.GL_FLOAT, false, 12, vertexBuffer); | |
GLES20.glEnableVertexAttribArray(colorHandle); | |
GLES20.glVertexAttribPointer(colorHandle, 4, GLES20.GL_FLOAT, false, 16, colorBuffer); | |
GLES20.glDrawElements(GLES20.GL_TRIANGLES, vertCount, GLES20.GL_UNSIGNED_SHORT, indexBuffer); | |
GLES20.glDisableVertexAttribArray(positionHandle); | |
GLES20.glDisableVertexAttribArray(colorHandle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment