下载freeglut
由于OpenGL是一种不依赖于平台性的图形api,所以诸如控制窗口和输出的操作是不包含在OpenGL里面的。这时我们需要第三方工具,如glut。
glut全称为 OpenGL Utility Toolkit,即OpenGL实用工具箱。 官方网址在这里。由于官方只提供了源代码,我们可以从官方链接里找到Martin Payne’s Windows binaries (MSVC and MinGW)。我们只需要从这个链接里拿到lib或dll和.h文件就可以使用freeglut了。
配置freeglut
这里使用VS2013进行开发,为了学习的方便性,不会每次都设定.lib和.h文件目录,所以将会放到默认vs指定的目录。以下是官方提示:
Installing the Libraries with MSVC
To install “freeglut” on your system so that your other projects will see it,
you will need to copy various files to various locations.
- The header files “freeglut.h”, “freeglut_ext.h”, “freeglut_std.h”, and
“glut.h” (distributed in the directory “freeglut\freeglut\include\GL”)
need to be copied to