因为我在设置 Visual Studio 2008 以使用 OpenGL 时遇到了很多问题,所以我会问这个对某些人有用的问题:
As I had many problems setting Visual Studio 2008 for using OpenGL I will ask this question that can be useful to some people:
在 Visual Studio 2008 中使用 OpenGL 和 C++ 需要遵循哪些步骤?
Which are the steps to follow in order to use OpenGL with C++ in Visual Studio 2008?
首先,您需要有一个视频卡并检查它是否可以与 OpenGL 配合使用,并且驱动程序是否已更新.我在这个链接 检查它.
First of all you need to have a video card and check that it works with OpenGL and the drivers are updated. I used the test in this link to check it.
检查是否正确安装了 Visual Studio 2008 以及是否在您的计算机中创建了以下路径也很重要:
It is also important to check that Visual Studio 2008 is correctly installed and that the following path is created in your computer:
C:Program FilesMicrosoft SDKsWindowsv6.0A
C:Program FilesMicrosoft SDKsWindowsv6.0A
现在我们可以按照安装步骤进行:
Now we can follow the installation steps:
1.- 下载 GLUT 从 https://www.opengl.org/resources/libraries/glut/glut_downloads.php,按照以下说明解压并复制文件:
1.- Download GLUT from https://www.opengl.org/resources/libraries/glut/glut_downloads.php, unzip and copy the files as instructed below:
2.- 创建一个空的 C++ Win32 应用程序:
2.- Create an empty C++ Win32 application:
3.- 添加一个新的 C++ 源文件:
3.- Add a new C++ source file:
4.- 链接到 OpenGL 库(重要步骤):
4.- Link to the OpenGL libraries (important step):
5.- 下载此示例代码.
6.- 还需要在 Visual Studio 中设置路径:
6.- It is also necessary to set the paths in Visual Studio:
在工具 -> 选项 -> VC++ 目录 -> 包含文件:
In Tools -> Options -> VC++ Directories -> Include Files:
C:Program FilesMicrosoft SDKsWindowsv6.0AInclude
C:Program FilesMicrosoft SDKsWindowsv6.0AInclude
在配置属性→链接器→附加库中目录:
In Configuration Properties → Linker → Additional Library Directories:
C:Program FilesMicrosoft SDKsWindowsv6.0ALib
C:Program FilesMicrosoft SDKsWindowsv6.0ALib
这篇关于如何在 Windows 7 中使用 OpenGL、Glut 和 Visual Studio 2008 准备 C++ 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!