GLUT- loop to draw

Hi,

I'm not so well equipped in english but i have a problem with the (good) old GLUT.
I'm trying to make a small Lightcycle Clone to practice in c++ and OpenGL, I'm ugly new with all that stuff.

Now it's the thing that the loop I want to render the points to make the lightcycle line doesn't return. It just renders one point.

I startet to implement this code snippet in the main, in the glutDisplayFunc and for some reason in the glutKeyboardFunc.

Nothin happens...

I think the whole thing needs a return command somewhere, but doesn't the glut mainloop already do this? It should repeat the whole function, i read somewhere...

Here's the snippet to render the lightcycle (richtungp1 defines the direction up/down/left/right and Ply1linex and Pl1liney the coordinates:

void ZeichnePly1(void)
{
//float Pl1altx = Ply1linex;
//float Pl1alty = Ply1liney;
if (richtungp1 = 0)
{
Ply1liney = Ply1liney+0.01;
}
if (richtungp1 = 1)
{
Ply1linex = Ply1linex + 0.01;
}
if (richtungp1 = 2)
{
Ply1liney = Ply1liney - 0.01;
}
if (richtungp1 = 3)
{
Ply1linex = Ply1linex - 0.01;
}
glColor3f(0.0f, 1.0f, 0.0f);
glBegin(GL_POINTS);
glVertex2i(GLfloat(Ply1linex), GLfloat(Ply1liney));
glEnd();


}
Topic archived. No new replies allowed.