我正在 Windows7 64 位上为 Visual Studio2012 设置 FREEGLUT 和 GLEW。 首先,我还需要设置 GLUT 吗?
第二,我很困惑,在 GLEW/lib 和 GLEW/bin 中都有 Release 和 Release MX 文件夹,我应该选择哪一个文件?
最佳答案
关于 GLEW:
我建议您暂时使用 GLEW,当您需要 GLEW MX(M多渲染内容xts)提供的附加功能时,请切换到它。
根据http://glew.sourceforge.net/advanced.html
Starting with release 1.2.0, thread-safe support for multiple rendering contexts, possibly with different capabilities, is available. Since this is not required by most users, [GLEW MX] is not added to the binary releases to maintain compatibility between different versions.
以下是构建 glew 的方法:
Note: Just because you are using a 64 bit machine, doesn't mean that you have Visual Studio set up to run 64 bit applications. I suggest you use the 32 bit versions of libraries until you are ready to reap the benefits of using the 64 bit versions, as you can switch later.
1. 将您的项目与 lib 文件夹中的静态 GLEW 库链接。这是 glew32s.lib 或 GLEW,具体取决于您的平台。
Note: glew32s.lib is to link statically, glew32.lib (without the s) is to link dynamically.
If you prefer to dynamically link with GLEW instead, leave out the define and link with glew32.lib instead of glew32s.lib on Windows. Don't forget to include glew32.dll or libGLEW.so with your executable!
2.将 include 文件夹添加到包含路径中。
3. 在程序中包含该 header ,但请确保将其包含在 OpenGL header 或用于创建窗口的库之前。
关于过剩:
其他人可以回答(或编辑我的答案)吗,因为我还没有使用过 GLUT。
用于此答案的其他来源:
关于visual-studio-2012 - 设置 GLEW、FREEGLUT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18969638/