Hi guys, I've just started learning OpenGL and I just wrote a very simple program that draws a triangle. The problem is that if I use GLUT_DOUBLE instead of GLUT_SINGLE in glutInitDisplayMode(), nothing shows up in the window. I don't know why that is and that's why I'm posting here. I don't quite understand the difference between GLUT_SINGLE and GLUT_DOUBLE.
here's my code:
Code:
void draw()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glBegin(GL_TRIANGLES);
glVertex3f(0,1,0);
glVertex3f(.5,0,0);
glVertex3f(1,1,0);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA | GLUT_DEPTH); // <--- if I change the GLUT_SINGLE to GLUT_DOUBLE then nothing shows up
glutInitWindowSize(400, 400);
glutInitWindowPosition(100,100);
glutCreateWindow("Testing");
glutDisplayFunc(draw);
glutMainLoop();
return 0;
}
Any help would be greatly appreciated, thank you!