Introduction to a series of simple tutorials
Over recent weeks, I have spent many hours updating previous OpenGL projects to work without using the deprecated fixed function pipeline. The reason for this is to future proof some of my 3D tools in case the required functionality is ever dropped from the OpenGL driver provided by FreeBSD.
Admittedly I was at first quite skeptical of the new(ish) way of doing things and hated the idea of breaking the backwards compatibility of older OpenGL (especially closed source) software. However, NVIDIA for one has stated that they will not be removing fixed function pipeline emulation for some time in their drivers but also the fact that the new OpenGL API is much much cleaner and nicer to work with without having to worry about such intricate state changes.
Using shaders is not a new concept but previously my software also used a fair chunk of fixed functionality (such as the inbuilt matrix system) and this needed to be changed out and the work delegated to a shader and implemented myself.
The road to completion has generally been very troubled since there is a lack of definitive documentation. Instead many tutorials mix and match parts of the fixed function pipeline with a few of the new OpenGL APIs.
This hasn't been helped by the fact that the OpenGL driver provided by Mesa on FreeBSD reports version 1.4 and thus some of the newer features (such as those found in the 4.x core profile) are not available to me or do not work by default. Luckily for me there are many extensions to the OpenGL implementation for my Intel GMA 950 graphics card so I can still do pretty much anything.
I have decided to attempt to document the steps required to build a sizable OpenGL project which can perform all tasks using shaders, whilst at the same time working on older cards as well as more recent hardware. So whilst I will be using OpenGL 2.x, I will not be using functionality such as glTranslatef, or GL_LIGHTING so the same code should work perfectly with OpenGL 4.3 and OpenGLES 2.0.
The first tutorial in the series is to simply get a Glut window open and displaying ready for the later steps. I am using C++ but will not be creating classes since I feel this complicates things greatly in tutorials. I will also only be using standard libraries provided by the OpenGL SDK since I also dislike learning from other developers "wrapper" classes. (I have not yet decided whether to use OpenIL (DevIL) or libpng for the textures...)
OpenGL Book (http://openglbook.com)
OpenGL Programmers Guide (6th edition) (Red Book)
Swiftless (Deprecated) (http://www.swiftless.com/opengltuts.html)
LazyFoo (Deprecated) (http://lazyfoo.net/tutorials/OpenGL)