VS2010下配置使用OpenGL的glut库
2015-02-28 16:41
232 查看
在win7(windows7 ultimate SP1)下成功安装VS2010(Visual Studio 2010 ultimate x86)。
下载glut:http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
(参见:http://www.opengl.org/resources/libraries/glut/glut_downloads.php)
原文讲:If you want just the GLUT header file, the .LIB, and .DLL files all pre-compiled for Intel platforms, you can simply download the glutdlls37beta.zip file (149 kilobytes).
这个zip文件中有5个文件:
![](http://www.xker.com/xkerfiles/allimg/1108/095324AP-0.jpg)
分别把这5个文件放到如下文件夹中:
glut.h ---> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\gl
glut.dll,glut32.dll ---> C:\Windows\SysWOW64 (windows7 64位操作系统)
---> C:\Windows\System32 (windows7 32位操作系统)
glut.lib,glut32.lib ---> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
编写代码时,加入头文件#include <gl\glut.h>即可。
配置完成。
测试代码:
#include <gl\glut.h>
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
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);
glutMainLoop();
return 0;
}
下载glut:http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
(参见:http://www.opengl.org/resources/libraries/glut/glut_downloads.php)
原文讲:If you want just the GLUT header file, the .LIB, and .DLL files all pre-compiled for Intel platforms, you can simply download the glutdlls37beta.zip file (149 kilobytes).
这个zip文件中有5个文件:
![](http://www.xker.com/xkerfiles/allimg/1108/095324AP-0.jpg)
分别把这5个文件放到如下文件夹中:
glut.h ---> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\gl
glut.dll,glut32.dll ---> C:\Windows\SysWOW64 (windows7 64位操作系统)
---> C:\Windows\System32 (windows7 32位操作系统)
glut.lib,glut32.lib ---> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
编写代码时,加入头文件#include <gl\glut.h>即可。
配置完成。
测试代码:
#include <gl\glut.h>
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
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);
glutMainLoop();
return 0;
}
相关文章推荐
- VS2010下配置使用OpenGL的glut库
- VS2010下配置使用OpenGL的glut库
- VS2010下配置使用OpenGL的glut库
- VS2010下配置使用OpenGL的glut库
- VS2010下配置使用OpenGL的glut库
- 孙其功陪你学之——VS2010下配置使用OpenGL的glut库
- VS2010下配置使用OpenGL的glut库
- vs2010下OpenGL的GLUT库配置
- VS2010下配置使用OpenGL的glut库
- 为Vs2010配置OpenGL使用环境
- VS2010下的OpenGL环境配置和使用
- 《Visual C++ 2010入门教程》系列二:安装、配置和首次使用VS2010
- 一起谈.NET技术,Qt简介以及如何配置Qt使用VS2010进行开发
- Qt配置使用VS2010进行开发
- VS2010环境下配置OpenGL
- Qt简介以及如何配置Qt使用VS2010进行开发
- OpenGL学习入门之VS2010环境配置
- Qt配置使用VS2010进行开发
- win7和VS2010下配置OpenGL的方法
- 32位XP下的VS2010 OpenGL GLUT配置