开发者

Visual Studio C++ 2010 express and OpenGL

I want to be able to compile OpenGL4.1 (C/C++) applications from VisualC++ 2010.

After doing a search I only found: http://www.opengl.org/sdk/ and the documentation: (which is fine) http://www.opengl.org/sdk/docs/man4/

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开发者_如何学JAVA should use.


You don't need to download anything to use OpenGL. Just add

#include <gl/GL.h>
#include <gl/GLU.h>

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")

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.


I believe the windows sdk includes opengl. Just include windows.h before including GL/gl.h

http://www.opengl.org/resources/faq/technical/gettingstarted.htm

Search 2.070


For Windows you have to use the SDK form the manufacturer of your graphics card. For Nvidia SDK is available for free download, for registered users. The OpenGL SDK link that you have shown IMO is only the specification, just like how OpenGL is only the API specification.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜