Commit 479e6cc1 authored by Vinson Lee's avatar Vinson Lee

draw-vertices: Move declaration before code.

parent 4196b52e
......@@ -389,15 +389,17 @@ static void test_interleaved_vertices(float x1, float y1, float x2, float y2, in
{{x2, y1}, {0}}
};
/* Set color green */
unsigned int i;
GLuint vbo;
/* Set color green */
for (i = 0; i < 3; ++i)
v[i].c[offset[index] - 3] = 0xff;
glEnableClientState(GL_COLOR_ARRAY);
GLuint vbo = vboVertexColorPointer(2, GL_SHORT, sizeof(struct vertex), 0,
3, GL_UNSIGNED_BYTE, sizeof(struct vertex), offset[index],
v, sizeof(v));
vbo = vboVertexColorPointer(2, GL_SHORT, sizeof(struct vertex), 0,
3, GL_UNSIGNED_BYTE, sizeof(struct vertex), offset[index],
v, sizeof(v));
glDrawArrays(GL_TRIANGLES, 0, 3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment