VS2010下配置使用OpenGL的glut库
2016-01-26 09:27
323 查看
http://www.xker.com/page/e2011/0805/102107.html
在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个文件:
分别把这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;
}
在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个文件:
分别把这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环境
- Linux开机进入图形桌面的方法
- EL表达式之sessionScope
- Jdk+MyEclipse+Tomcat的安装教程
- 如何才能做到网站高并发访问
- 嵌入式linux:uclibc,eglibc,glibc之间的区别和联系
- EL表达式之sessionScope
- 从源码角度理解nginx和uwsgi的通信过程
- nginx_lua 扩展让 nginx 拥有可编程能力
- 嵌入式linux:Ubuntu系统下bash和dash的区别(修改默认sh为bash)
- Linux时间子系统之一:clock source(时钟源)这系列文章很不错!
- 大型网站架构之分布式消息队列
- 跨windows和linux的线程类
- nginx后端服务器返回给nginx502、504、404、执行超时等错误状态的解决方法
- 02-topdown
- 只有一个苹果开发集合网站地址的随笔
- linux 添加服务器信任关系 & scp的使用
- lodop 破解版+使用教程 目前最全的客户端打印
- 运维小知识之nginx---nginx配置Jboss集群负载均衡
- export 原理解析 (Shell Script)