Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 should use.

like image 590
Ron Avatar asked Feb 20 '11 04:02

Ron


2 Answers

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.

like image 55
Alexander Rafferty Avatar answered Sep 21 '22 13:09

Alexander Rafferty


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

like image 21
Xzhsh Avatar answered Sep 17 '22 13:09

Xzhsh