why GL_LINE_LOOP doesn't work
Hi, I wrote a simple function,
b2Vec2 vertices[vertexCount];
vertices[0].x = 100; vertices[0].y = 100;
vertices[1].x = 210; vertices[1].y = 100;
vertices[2].x = 210; vertices[2].y = 210;
vertices[3].x = 100; vertices[3].y = 210;
vertices[4].x = 100; vertices[4].y = 100;
vertexCount = 5;
glVertexPointer(2, GL_FLOAT, 0, vertices);
//glDrawArrays(GL_POINTS, 0, vertexCount);
glDrawArrays(GL_LINE_LOOP, 0, vertexCount);
if I use glDrawArrays(GL_POINTS, 0, vertexCount); 4 points are drawn, but if I use glDrawArrays(GL_LINE_LOOP, 0, vertexCount); nothing is displayed on screen. glGetError returns no error. Did I miss any simple stuff?
thanks!
|