Original Post
I have this problem. I want to use GL_LINES to draw a screen saver pattern, but I can''t figure out how to do this without a for statement with calls to glVertex:
glBegin(GL_LINES);
glColor3d(r,g,b);
for(float j=-10;j<10;j+=0.5f)
{
glVertex2f(0,0);
glVertex2f(j,-6);
}
glEnd();
I want "j" to increment over time not all at once. I have tried this:
static float j=-10;
glBegin(GL_LINES);
glColor3d(r,g,b);
glVertex2f(0,0);
glVertex2f(j,-6);
glEnd();
j+=0.1f;
but it doesn''t work. I kinda want the lines to draw every 2 or 3 seconds, maybe I should use a timer?? A timer seems like a waste of system resources for something so simple, though.