win7 64 &vs2010 与 opengl配置

摘要:
http://blog.csdn.net/lixam/article/details/7618015http://blog.sina.com.cn/s/blog_7745fc8601017m36.html_________________________________________________________________我的配置是:1.将提取的过剩。h转换为“C:ProgramFi

http://blog.csdn.net/lixam/article/details/7618015

http://blog.sina.com.cn/s/blog_7745fc8601017m36.html

_________________________________________________________________

我的配置:

1. 把解压得到的glut.h放到"C:Program Files (x86)Microsoft SDKsWindowsv7.0AIncludegl"
      2. 把解压得到的glut.lib和glut32.lib放到"D:ToolsMicrosoft Visual Studio 10.0VClib" (安装目录)
      3. 把解压得到的glut.dll放到"C:WindowsSysWOW64"(win7 64位)
      4. 把glut32.dll放到“D:ToolsMicrosoft Visual Studio 10.0VCin”下(注意这个,网上有人说放到system32里,但是我试过,会报错)(安装目录)
      5. 打开vs2010,随便打开或新建一个项目。 选择 project->project property-> Configuration Properties->Linker->Input->Additional Dependencies 在其中添加opengl32.lib glu32.lib glut32.lib

测试代码

#include <Windows.h>  
#include <gl/GL.h>  
#include <gl/GLU.h>
#include <gl/glut.h>
void init()  
{  
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);  
glShadeModel(GL_SMOOTH);  
}  
void draw_triangle()  
{  
glBegin(GL_POLYGON);  
glVertex3f(0.25f, 0.25f, 0.0f);  
glVertex3f(0.75f, 0.25f, 0.0f);  
glVertex3f(0.75f, 0.75f, 0.0f);  
glVertex3f(0.25f, 0.75f, 0.0f);  
glEnd();  
}  
void display()  
{  
glClear(GL_COLOR_BUFFER_BIT);  
draw_triangle();  
glFlush();  
}  
void reshape(int w, int h)  
{  
glViewport(0, 0, (GLsizei) w, (GLsizei) h);  
}  
int main(int argc, char **argv)  
{  
glutInit(&argc, argv);  
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);  
glutInitWindowPosition(600, 400);  
glutInitWindowSize(800, 600);  
glutCreateWindow("OpenGL Hello World");  
init();  
glColor3f(1.0f, 1.0f, 1.0f);  
glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);  
glutDisplayFunc(display);  
glutReshapeFunc(reshape);  
glutMainLoop();  
return 0;  
}  

  

免责声明:文章转载自《win7 64 &amp;amp;vs2010 与 opengl配置》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Docker 容器(container)及资源限制位运算符、按位与、按位或、按位非、左移、右移、原码、反码、补码下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

docker占满linux磁盘根目录的解决办法

一、磁盘根目录被占满 [test@localhost docker]$ df -lh Filesystem Size Used Avail Use%Mounted on /dev/mapper/centos-root 50G 50G 0G 100% / devtmpfs 7.7...

glViewport()函数和glOrtho()函数的理解

在OpenGL中有两个比较重要的投影变换函数,glViewport和glOrtho.glOrtho是创建一个正交平行的视景体。 一般用于物体不会因为离屏幕的远近而产生大小的变换的情况。比如,常用的工程中的制图等。需要比较精确的显示。 而作为它的对立情况, glFrustum则产生一个透视投影。这是一种模拟真是生活中,人们视野观测物体的真实情况。例如:观察两...

Makefile系列之一 : 书写规则

1. 规则 target : prerequisites       command 2. example excute 为最终生成的可执行文件。 可以通过命令 make clean来删除所有编译时产生的中间文件。 excute : main.o a.o b.o c.o d.o cc -o excute main.o a.o b.o c.o d....

Qt FFMPEG+OpenCV开启摄像头

//ffmpegDecode.h #ifndef __FFMPEG_DECODE_H__ #define __FFMPEG_DECODE_H__ #include "global.h" extern "C" { #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" /...

SSI简介 与 nginx开启SSI

Server Side Include : 服务器端嵌入 原理 : 将内容发送到浏览器之前,可以使用“服务器端包含 (SSI)”指令将文本、图形或应用程序信息包含到网页中。因为包含 SSI 指令的文件要求特殊处理,所以必须为所有 SSI 文件赋予 SSI文件扩展名。默认扩展名是 .stm、.shtm 和 .shtml 主要有以下几种用用途: 1、显示服务器...

SVN图形管理工具-Submint

1.安装svn及相关依赖包 yum install subversion httpd mod_dav_svn apr-util-sqlite   2.下载submin wget https://supermind.nl/submin/current/submin-2.2.2-1.tar.gz tar zxvf submin-2.2.2-1.tar.g...