Sunday, 9 December 2012

Simple window OpenGL program

OpenGL program for display a simple window


#include <gl/glut.h>
void initGL()
{
    glClearColor(1.0f,1.0f,1.0f,1.0f);
}

void display()
{
    glClear(GL_COLOR_BUFFER_BIT);
    glFlush();
      
}
int main(int argc,char** argv)
{
    glutInit(&argc,argv);

    glutInitWindowSize(400,400);
    glutInitWindowPosition(100,100);
    glutCreateWindow("Simple Window");
    glutDisplayFunc(display);
    initGL();
    glutMainLoop();
    return 0;
}

output

Simple window OpeGL
Simple window OpeGL

 


No comments:

Post a Comment