Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was reading about OpenGL, and found out the Red Book is a great book for me to read to learn. I then read that even though they have 3.x and 4.x versions, I should still stick to 2.x so I don't create an artificial limit on who can play my game (older computers with older but powerful graphics cards would not be able to run 3.x and 4.x GL software).

So where do I start? I'm lost. Which book? I have no problem reading the 2.x version of the Red Book, which I believe is this one: but I won't know whats deprecated :(

cry for help

share|improve this question
This is practically the same question as this:… – Tetrad Nov 27 '10 at 15:00
Simple google result that would help: – Tetrad Nov 27 '10 at 15:01
And -1 to you if I could, Tetrad. I didn't ask if it was pointless learning OpenGL 2.x, 3.x or 4.x. I asked WHICH book I should use as the best reference. – shadowprotocol Nov 27 '10 at 16:03
shadowprotocol, then your question is worded totally wrongly. The title indicates whether to choose GL 2.x-4.x, whereas you're meaning books. – The Communist Duck Nov 27 '10 at 18:14
@Duck: If so, it's a dupe of another question: – greyfade Nov 27 '10 at 22:07
up vote 3 down vote accepted

With shaders, it's possible to use OpenGL 2.1 without the fixed function pipeline that is deprecated in versions 3.x and later.

share|improve this answer

I have used OpenGL 2 for many years, and I have just recently learned the basics of OpenGL 3. Having learned both, I would recommend without a doubt that you learn OpenGL 2 first. And I wouldn't even say "avoid using functions which are deprecated in OpenGL 3", because pretty much everything is deprecated in OpenGL 3. Basically, OpenGL 3 is ridiculously hard for a newbie to learn, so you should first learn OpenGL 2 and then read up on what it takes to get OpenGL 3 working.

In OpenGL 2, there are two modes of sending mesh data to the GPU -- "immediate mode" (glBegin, glVertex, glEnd) and "retained mode" (vertex buffers and so on). And then there are two ways to have your meshes displayed -- "fixed functionality" (the graphics card will automatically transform your vertices into the correct place on the screen, perform simple lighting calculations, etc) or "custom shaders" (you must write all the transformation and lighting calculations yourself in a language called GLSL).

So whenever you use OpenGL 2, you must make those two orthogonal choices: immediate vs retained, and fixed functionality vs custom shaders. Immediate is easier than retained, and fixed is easier than shaders. But the immediate mode is awful for performance (as you must send the full mesh data to the GPU every single frame), and the fixed functionality will not work for any effects you might have seen in the last 8 years or so, like bump mapping and phong shading. So both immediate mode and fixed functionality have been removed from OpenGL 3.

That's why I recommend you learn OpenGL 2 first. Maybe try immediate mode with fixed functionality. Then go up to retained mode (use vertex buffers). Then try writing a custom vertex and fragment shader in GLSL. Only once you have mastered all of that will you be able to even think about not using any of the deprecated functions (since in OpenGL 3, you must always use retained mode and write your own shaders). Finally, you will be able to switch over to OpenGL 3.

If you are actually releasing a game, OpenGL 2 is fine and will be supported for many years. But there is still a good reason to be using retained mode (speed) and custom shaders (better lighting and cool effects).

share|improve this answer
Great summary of the changes to OpenGL3 – Ken Sep 19 '11 at 20:50
Which online tutorials can you recommend, specifically? – Anderson Green Dec 14 '12 at 4:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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