first opengl

#include <stdlib.h>
#include <stdio.h>

#include<glut.h>

void myDisplay(void)
{
     glClear(GL_COLOR_BUFFER_BIT);
     glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
     glFlush();
	 printf ("display done\n");
}
int main()
{ 
    glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
    glutInitWindowPosition(100, 100);
    glutInitWindowSize(400, 400);
    glutCreateWindow("第一个OpenGL程序");
    glutDisplayFunc(&myDisplay);
    glutMainLoop();
     return 0;
}



   

你可能感兴趣的:(buffer,include)