搜索
您的当前位置:首页正文

实验一代码

来源:二三娱乐
#include \"stdafx.h\" #include #include void Initial (void) { glClearColor (1.0f,1.0f,1.0f,1.0f); glMatrixMode (GL_PROJECTION); gluOrtho2D (0.0,200,0.0,150.0); }

void myDisplay (void) { glClear (GL_COLOR_BUFFER_BIT); glColor3f (0.0f,0.0f,0.0f); glRectf (50.0f,100.0f,150.0f,50.0f); glFlush(); }

int main(int argc, char* argv[]) { glutInit (&argc,argv); glutInitDisplayMode (GLUT_RGB/GLUT_SINGLE); glutInitWindowPosition (100,100); glutInitWindowSize (400,400); glutCreateWindow (\"第一个OpenGL程序\"); glutDisplayFunc (&myDisplay); Initial(); glutMainLoop (); return 0; }

因篇幅问题不能全部显示,请点此查看更多更全内容

Top