Original Post
hi, I'm new to OPENGL so you might find my question to be trivial. I'm writing a small animation program using double buffers to simulate the movement so I'm using function such as: glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB); glutSwapBuffers(); glutPostRedisplay(); The problem is that I don't get any display at all Here are the parts of the code where I think the problem is: the myDisplay function works fine...I tried it using a single buffer... Thanks :)
void main(int argc , char**argv)
{
glutInit(&argc , argv); //initialize the toolkit
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB); //sets the display mode
//sets the window size
glutInitWindowSize(720,655);
//sets the window position
glutInitWindowPosition(200,25);
glutCreateWindow("Drawing polygons "); //open the screen window
myInit();
glutDisplayFunc(myDisplay);
glutSwapBuffers();
idle();
glutMainLoop();
}
oid myInit(void)
{
glClearColor(1.0,1.0,1.0,0.0); // set white background color
//glColor3f(1.0f,0.0f,0.0f); // sets the drawing color to be red
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0,640, -20.0,480); // the transformation of the screen
}
void idle()
{
theta += 2;
if(theta == 360)
theta= 0;
glutPostRedisplay();
}