background colour in opengl

Posted by lego69 on Stack Overflow See other posts from Stack Overflow or by lego69
Published on 2010-05-24T16:29:18Z Indexed on 2010/05/24 16:41 UTC
Read the original article Hit count: 321

Filed under:
|

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;
    }

© Stack Overflow or respective owner

Related posts about opengl

Related posts about graphics