13
votes
\$\begingroup\$

Is there a good tutorial that shows the difference between OpenGL 1.* and 2.*?

It would be very helpful to know which functions I should not be calling (like glBegin(), I assume).

\$\endgroup\$
  • \$\begingroup\$ The History of OpenGL page on the OpenGL wiki lists the changes each version introduced. \$\endgroup\$ – 魔大农 Apr 14 at 0:19
11
votes
\$\begingroup\$

In short, OpenGL 2.0 lives between the fixed function (1.x) and fully programmable (2.x+) world; you can still use everything OpenGL 1.x has, while adding shaders. Moving forward (3.x+), all sorts of old fixed function systems start to get deprecated though, so it may be better to have a clean start instead of mixing both worlds.

\$\endgroup\$
3
votes
\$\begingroup\$

OpenGL versions, by and large, are not like Direct3D versions. Your old code still works with the new versions (with one exception). Therefore, OpenGL v1.4 will function just fine under OpenGL 2.1. OpenGL versions are additions, not subtractions.

OpenGL 2.0 and 2.1 add shaders, in the OpenGL Shading Language. They also add several other features, like floating-point textures, non-power-of-two textures, and so forth. The full list is available in the OpenGL 2.1 specification itself. Just look at the "Version" sections; they will tell you what changed from the previous version.

The only exception to the rule about API changes is OpenGL 3.1 (yes, 3.1, not 3.0). In OpenGL 3.0, a number of APIs were designated as "deprecated". This means that the ARB, the committee in charge of OpenGL, could remove these functions from later versions. This removal happened in OpenGL 3.1. The 3.0 specification has a big list of deprecated stuff in it, and the 3.1 spec is trimmed down accordingly.

Note that you don't have to care (at least on Windows and Linux. MacOSX is different). You can run just fine in "compatibility" mode, where all of the previously removed features return. Implementations of OpenGL don't have to support compatibility contexts (and Mac OS X Lion doesn't. It supports either 2.1 or 3.2 core, at you request), but all of them still do. Just for backwards compatibility with older applications.

\$\endgroup\$

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