repeating lines???


Here is the code that I have been working on for the last few hours…I know that I have to use a for loop to make my lines repeat, but how do I go about doing this?

void DrawPixel( int x, int y )
glBegin( GL_POINTS );
glVertex2f( x,y );
glEnd( );

void DrawLine( float x0, float y0, float x1, float y1 )
// repeatedly call DrawPixel from this function


glutSwapBuffers( );


thank you ALLL for everything!
I wish I caould buy you all Drinks!

Are you drawing straight lines?
why not use GL_LINE etc.?

Hi Gavin,

thanks for the reply, and I am drawing straight lines. How do I go about using GL_Lines???


Actually, I need to use drawpixel and use my DrawLine function to call drawpixel repeatedly so that can just press a key and have that line repeat over and over…



glVertex3f(sx, sy, sz);
glVertex3f(ex, ey, ez)

Obviously you can repeat this as many times as you want.