OpenGL is a graphics programming API for 3D Graphics, based on the "GL" library from SGI (a major vendor of early computer graphics hardware and software). OpenGL and Microsoft's Direct3D are the two major standards used for modern 3G programming, with Direct3D being exclusive to the Microsoft platforms (Windows and XBox).

Thanks to a pointer in a comment on Jamie Zawinski's LiveJournal I discovered a "Modern OpenGL" tutorial being written by Joe Groff. It's only a few chapters in at present, but is aiming to explain the common modern subset of OpenGL starting with "Hello World" applications (chapter 2 is effectively 2D fading between two images, and chapter 3 adds 3D transformations). There is example code, available from github (chapter 2; chapter 3), which avoids the need to type anything in.

Following the tutorial on MacOS X is pretty easy if you already have Apple's Development Tools and MacPorts installed. Everything needed to compile the tutorial programs is already installed apart from GLEW, the OpenGL Extension Wrangler Library, and that is easily installed from MacPorts, viz:

sudo port install glew

(Helpfully the OS X Makefile supplied with the tutorial programs, from github, assumes the same install location as MacPorts chooses.)

After that Chapter 2 can be tested with:

git clone git://github.com/jckarter/hello-gl.git
cd hello-gl
make -f Makefile.MacOSX hello-gl-dummy
make -f Makefile.MacOSX hello-gl
./hello-gl-dummy
./hello-gl

(where the hello-gl-dummy is the minimal version needed to compile and run without doing anything, and hello-gl includes the full example from Chapter 2.)

And Chapter 3 can be tested with:

git clone git://github.com/jckarter/hello-gl-ch3.git
cd hello-gl-ch3
make -f Makefile.MacOSX hello-gl
./hello-gl SHADER.v.glsl

where SHADER.v.glsl is the vertex shader to use (there are several of them described in Chapter 3 with different degrees of sophistication). (Beware that the default chapter 3 code will use the hello-gl.v.glsl vertex shader from chapter 2 as the default shader if none are specified, so run naively it will appear the same as chapter 2.)

ETA, 2010-08-17: Further LazyWeb post on OpenGL from jwz, which has lots of useful hints/links in the comments. (Unfortunately it mostly reveals that there is a decade or more of complexity in the variety of OpenGL(-ES) standards and that almost everyone has given up and is using middleware to abstract away from the differences.)

Also, Chapter 4 of tutorial, was released last month, and can be tested with:

git clone git://github.com/jckarter/ch4-flag.git
cd ch4-flag
make -f Makefile.MacOSX flag
./flag

R (in the GL window) can be used to reload the shader program when experimenting with the variations suggested in the chapter.