Visual Studio C ++ 2010 express和OpenGL
我想要能够从VisualC ++ 2010编译OpenGL4.1(C / C ++)应用程序。
I want to be able to compile OpenGL4.1 (C/C++) applications from VisualC++ 2010.
搜索后,我发现:
http://www.opengl.org/sdk/
和文档:(其是罚款)
http://www.opengl.org/sdk/docs/man4 /
这有点混乱,我真的不知道要安装什么才能开始。我甚至不能找到下载链接,或者我应该使用什么OpenGL项目。
Which is a bit confusing, and I really don't know what to install to get started. I can't even find a download link, or what OpenGL projects I should use.
任何使用OpenGL。只需添加
You don't need to download anything to use OpenGL. Just add
#include <gl/GL.h>
#include <gl/GLU.h>
到您的源文件的顶部。你还需要链接库,这在MSVC可以这样做:
to the top of your source file. And you also need to link the libraries, which in MSVC can be done like this:
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
微软提供的头文件,你被困在版本1.1的ogl。我建议从OpenGL网站,以及像GLEW得到最新的扩展头。这将允许您访问OpenGL中最新的可用函数和常量。
With the header files provided with microsoft, you are stuck with version 1.1 of ogl. I suggest getting the latest extension headers from the OpenGL website, as well as something like GLEW. This will give you access to the latest available functions and constants in OpenGL.