Rohit Shinde
Rohit Shinde

Reputation: 1603

OpenGL in Visual Studio 2013

I am looking for instructions in installing OpenGL in my version of Visual Studio 2013 Ultimate.

However, I can't find any instructions pertaining to VS 2013. The ones which I found were for VS 2012 or 2010 and they are apparently not working for VS 2013. This might be because I maybe doing it wrong.

I followed the instructions on this page and modified to fit my VS 2013, but no luck. How do I install OpenGL on my VS 2013?

A related question which I also have is this: Should I use FreeGlut library? And also, what is GLEW and GLFW? Which one of those should I use? Please keep in mind that I am just a beginner in OpenGL and will be learning using the red book and the openGL super bible.

Upvotes: 1

Views: 6939

Answers (2)

pcomitz
pcomitz

Reputation: 101

In Visual Studio Express Desktop 2013 , with freeglut installed, the following code :

const GLubyte *Vstr;
Vstr = glGetString(GL_VERSION);
fprintf(stderr, "Your OpenGL version is %s\n", Vstr);      

results in

Your OpenGL version is 4.2.0 - Build 10.18.10.3621.

Version 4.2 is from 2011. See https://www.opengl.org/wiki/History_of_OpenGL. Note that Version 1.1 (as indicated in another answer) is from 1997.

Upvotes: 0

derhass
derhass

Reputation: 45362

OpenGL is part of the Windows API. Visual Studio 2013 installs the Windows Kit (iirc in Version 8.1), which includes the GL.h header file and the opengl32.lib import library which will allow you to link opengl32.dll. So you do not need to "install" OpenGL in VS, it is already there.

You should just be aware that microsoft's GL is limited to Version 1.1 (which is ancient by todays standards). If you need a more modern implementation, you have to install a graphics driver with an OpenGL ICD ("installable client driver" - and they all do), and use the extension mechanism in your code. That is where the GLEW library might be useful: it is a GL extension loader library which will do all that for you.

What your link is about is freeglut, which is a completely independent library. It is about creating windows the GL can render to, capturing keayboard and mouse events and providing a simple render loop. GLFW is just a more modern alternative to that.

None of these libararies are strictly required for OpenGL. You can use the windows API to create windows and GL contexts, do the event handling, load the extension pointers and so on. However, using this libraries is more convenient and also increases portability of your code. GLEW, GLFW and GLUT are also available for Unix/Linux and OSX and some other platforms, and are not specific to just Windows.

Upvotes: 6

Related Questions