OpenGL(2) glut库测试
下载glut :http://www.opengl.org/resources/libraries/glut/
配置方法:
1、将glut.h添加到 C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl 中
2、将 glut.lib 和 glut32.lib 添加到 C:\Program Files\Microsoft Visual Studio 9.0\VC\lib 中
3、将 glut.dll 和 glut32.dll 添加到 C:\Windows\System32 中
测试:// opengl12.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "gl/glut.h" void display() { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POLYGON); glVertex2f(-0.5,-0.5); glVertex2f(-0.5,0.5); glVertex2f(0.5,0.5); glVertex2f(0.5,-0.5); glEnd(); glFlush(); } int _tmain(int argc, char** argv) { glutInit(&argc,argv); glutCreateWindow("Hello,world!"); glutDisplayFunc(display); glutMainLoop(); return 0; }配置:
结果:
转载于:https://blog.51cto.com/3754839/1401750