Quite recently I’ve been wanting to look into modern OpenGL and was a bit confused when I noticed all the options you have. Even before writing the simplest OpenGL application, you need to choose between GLUT, GLFW and other libraries. And then there’s also very very old stuff out there in the internet, that is still talking about the OpenGL fixed function pipeline from 1990 (like Nehe).
This post should give you a primer on what resources to consider and where to get started.
Setting up the project / IDE
First, let’s talk about the libraries that you’ll need. GLFW mainly takes care of the window and OpenGL context creation. It also has some basic functionality regarding, for example, keyboard input. GLEW, on the other hand, takes care of loading OpenGL extensions and also checks which OpenGL extensions are available on the client while run-time. GLM is a mathematics library designed specifically to simplify the mathematical aspects while using OpenGL – like matrices or quaternions. There are alternatives to some of those. For example, FreeGLUT is a alternative to GLFW and also takes care of the window and OpenGL context creation. However, GLFW seemed much simpler and easier to use to me, so I’ve decided to use it.
If you don’t want to hassle with compilingf all the libraries, then linking them and so on – I’ve uploaded a Visual Studio 2013 solution that contains GLFW, GLEW and GLM. Just download and run it – the libraries are only included in debug mode right now, I’ll update the project on a later date. Otherwise, you will need to download GLFW, GLEW and GLM. You’ll need to use CMake to compile GLFW and GLEW. GLM is a header-only library, so you’ll just need to point to the include files. All of them have a really nice site that helps you how to build or use them.
There are 2 free online tutorials that I can suggest:
While the last tutorial gets results very fast, it doesn’t really explain a lot of the stuff and what is going on in the background – that’s why I’d check out both at the same time. If you have the possibility to get or buy books, there are 2 huge ones that seem very nice.
I’m currently reading through the programming guide myself, which explains OpenGL very deeply. The Superbible has also been recommended a lot and should be just as good, if not better. Both of them definitely explain a wide range of content and are worth checking out – even if only as a reference.
I hope this helped some of you getting started a tad faster with modern OpenGL.