1 / 5

Opengl 配置

Opengl 配置. 第一步 选择编译环境. 以 vs2008 , vc6.0 为例. 第二步 安装 gult 工具包. 下载 gult 工具包,将其解压,会有 5 个文件( glut.h,glut.lib,glut32.lib,glut.dll,glut32.dll ) 搜索 gl.h 文件地址 X:ProgramFilesMicrosoftVisualStudioVC98IncludeGL (vc6.0) x:Program FilesMicrosoftVisual Studio 9.0VCincludeGL (vc2008)

odelia
Download Presentation

Opengl 配置

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Opengl配置

  2. 第一步 选择编译环境 以vs2008,vc6.0为例

  3. 第二步 安装gult工具包 • 下载gult工具包,将其解压,会有5个文件(glut.h,glut.lib,glut32.lib,glut.dll,glut32.dll) • 搜索gl.h文件地址 • X:\ProgramFiles\MicrosoftVisualStudio\VC98\Include\GL (vc6.0) • x:\Program Files\Microsoft\Visual Studio 9.0\VC\include\GL (vc2008) • 把glut.h放入gl文件夹 • 把glut.lib,glut32.lib放入lib文件夹(lib文件夹与include文件夹在同一目录下) • 把glut.dll,glut32.dll放入system32文件夹下(C:\WINDOWS\system32)

  4. 第三步 测试 • 建立一个空项目 • #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; • }

  5. 第三步 测试 • #pragma comment(lib, "opengl32.lib")#pragma comment(lib, "glu32.lib")#pragma comment(lib, "glut32.lib") • 项目->项目属性->连接器->命令行,附加选项中加入上述三个lib文件 • 工程->设置->连接->工程选项

More Related