change the buffer position before calling glVertexAttribPointer()

This commit is contained in:
Josh Holtrop 2012-11-06 22:18:31 -05:00
parent d1b87e3ec6
commit 0c45755ea1

View File

@ -100,8 +100,10 @@ public class MyRenderer implements GLSurfaceView.Renderer
GLES20.glEnableVertexAttribArray(attr_pos); GLES20.glEnableVertexAttribArray(attr_pos);
GLES20.glEnableVertexAttribArray(attr_color); GLES20.glEnableVertexAttribArray(attr_color);
checkGLError("glEnableVertexAttribArray"); checkGLError("glEnableVertexAttribArray");
m_quad_attrib_buffer.position(0);
GLES20.glVertexAttribPointer(attr_pos, 3, GLES20.GL_FLOAT, false, GLES20.glVertexAttribPointer(attr_pos, 3, GLES20.GL_FLOAT, false,
6 * 4, m_quad_attrib_buffer); 6 * 4, m_quad_attrib_buffer);
m_quad_attrib_buffer.position(3);
GLES20.glVertexAttribPointer(attr_color, 3, GLES20.GL_FLOAT, false, GLES20.glVertexAttribPointer(attr_color, 3, GLES20.GL_FLOAT, false,
6 * 4, m_quad_attrib_buffer); 6 * 4, m_quad_attrib_buffer);
checkGLError("glVertexAttribPointer"); checkGLError("glVertexAttribPointer");