vs2013配置OpenGL开发环境

来源:互联网 发布:mac装windows分区设置 编辑:程序博客网 时间:2024/06/04 19:52

一、下载并解压gult库文件
下载链接:http://download.csdn.net/detail/lwqbrell/9727737

解压后:

gult


二、将解压后的文件复制到相应的文件夹中

2-1、将glut.lib和glut32.lib到VS2013安装目录的\VC\lib文件夹中

2-2、将glut.h复制到VS2013安装目录的\VC\include\GL

注:如果在incluce目录下没有GL文件夹,可以自己创建一个

2-3、将glut.dll,glut32.dll复制到

C:\Windows\system32

‪‪C:\Windows\SysWOW64


三、编写opengl程序

#include "stdafx.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(){    glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);    glutInitWindowPosition(100, 100);    glutInitWindowSize(400, 400);    glutCreateWindow("OpenGL画正方形");    glutDisplayFunc(&myDisplay);    glutMainLoop();    return 0;}

四、运行查看效果

openg


五、详细内容可参考另一篇文章:http://www.cppblog.com/doing5552/archive/2009/01/08/71532.html

0 0
原创粉丝点击