background colour in opengl
- by lego69
I want to change background color of the window after pressing the button, but my program doesn't work, can somebody tell me why, thanks in advance
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(800, 600);
glutInitWindowPosition(300,50);
glutCreateWindow("GLRect");
glClearColor(1.0f, 0.0f, 0.0f, 1.0f); <---
glutDisplayFunc(RenderScene);
glutReshapeFunc(ChangeSize);
glutMainLoop();
system("pause");
glClearColor(0.0f, 1.0f, 0.0f, 1.0f); <---
return 0;
}