Hi folks
I have just a very simple question. How has my code to be, so that i have access to XXX and YYY in my “display” function. I know the Code below doesn’t work, but it shows the type of my problem
Thanks for help
B
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f(XXX, XXX, 0.0);
glVertex3f(YYY, XXX, 0.0);
glVertex3f(YYY, YYY, 0.0);
glVertex3f(XXX, YYY, 0.0);
glEnd();
glFlush();
}
main(int argc, char** argv)
{
float XXX=3;
float YYY=6;
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow(“hello”);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}