1

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.

2 Answers 2

6

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.

7
  • A question: How do I check whether my graphics card supports ICD or not? My graphics card is nVidia GeForce GT 540m Commented May 3, 2014 at 15:40
  • There are only 3 GPU vendors you might encounter on desktop systems currently: Intel, nVidia, AMD. They all provide OpenGL ICDs as part of their windows drivers. If you have the nvidia driver installed, you have access to modern OpenGL - via the extension mechanism.
    – derhass
    Commented May 3, 2014 at 15:46
  • Okay thanks! So what will be the next step? I mean how do I actually use OpenGL 4? Commented May 3, 2014 at 15:48
  • Well, the red book and the superbible should actually tell you how to.
    – derhass
    Commented May 3, 2014 at 16:44
  • Not really! The superbible tells me to include a header file called sb6.h, which I don't want to. I want to learn from the ground up. The Red book says <include whatever you need to> So you see, I am sort of stuck! Commented May 3, 2014 at 17:56
0

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.