I want to draw a series of connected lines (GL_LINE_STRIP) in following way.
I had tried to code by my own, but not get desired result, so i come here, help me to find out where i was wrong. here i am giving only my draw() function.
glBegin(GL_LINE_STRIP);
glVertex2f(-4.00, 0.00);
glVertex2f(-3.00, 2.00);
glVertex2f(-2.00, 0.00);
glVertex2f(-1.00, 2.00);
glVertex2f(0.0, 0.00);
glVertex2f(1.00, 2.00);
glVertex2f(2.00, 0.00);
glVertex2f(3.00, 2.00);
glVertex2f(4.00, 0.00);
glEnd();