Hi ,
I am trying to use glPrimitiveRestartIndex() to draw GL_LINES. Here is code :
const GLfloat data[] =
{
-0.9f, -0.6f,
-0.9f, -0.9f,
-0.6f, -0.9f,
-0.6f, -0.6f,
-0.3f,-0.6f,
-0.3f,-0.9f,
0.0f,-0.9f,
0.0f,-0.6f
};
GLuint indices [] = {0, 1, 2, 3 ,666, 4 , 5 ,6 , 7 };
glPrimitiveRestartIndex(666);
glDrawElements(GL_LINES, 9 , GL_UNSIGNED_INT ,(GLvoid *)0);
Now, with this code it draws only 3 parallel lines instead of 4.
But when i increase the count in glDraw to 10, it draws 4 lines correctly. Is it what expected?
When i replace GL_LINES with GL_TRIANGLE_FAN with count=9, it correctly draws 2 quads.
Please let me know where i am going wrong.
Thanks in advance,