没有人生,没有爱情!
分类: C/C++
2012-03-27 10:23:23
// file: basicOpenGlDemo.cpp
#include
static void displayFunc();
int main( int argc, char *argv[])
{
glutInit( &argc, argv );
glutInitWindowPosition( 1000, 100 );
glutInitWindowSize( 1024, 768 );
glutCreateWindow( "hello opengl" );
glClearColor( 1, 0, 0, 0 );
glutDisplayFunc( displayFunc );
glutMainLoop();
return 0;
}
void displayFunc()
{
glClear( GL_COLOR_BUFFER_BIT );
glFlush();
}
#g++ -framework GLUT -framework OpenGL main.cpp -o demo