下载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;
}
配置:
结果:
本文详细介绍了如何下载、配置并使用GLUT库,包括添加头文件、链接库及动态链接库到系统路径,以及通过编写简单的OpenGL程序进行测试。
606

被折叠的 条评论
为什么被折叠?



