Right, here's the example: http://www.alistairkeys.co.uk/download/opengl_2d.zip (238K). You need Tom Nuyden's gl units for it (http://www.delphi3d.net/dot/). Also, the .dcus should be dumped into the temp subdirectory to keep things cleaner.

You'll need Delphi 6 or better to compile as-is because I did stuff like the following:

[pascal]TTextureDimension = (td1D = GL_TEXTURE_1D,
td2D = GL_TEXTURE_2D,
td3D = GL_TEXTURE_3D_EXT);[/pascal]
(Notice the "= whatever" in that type.)

You can of course use earlier Delphi versions by getting rid of the declared types and just using Cardinals/Integers and the usual constants, if that's your thing -- I just wanted a more "Delphi" feel.

There are quite a few units in the example, which is just because I ripped it out of my general framework and made it a bit more tidy (there are still a few things that need sorted, esp. the texture class, but they're not that bad). You're interested in screen.pas, which shows the use of 2d. The idea is straightforward: you push the projection matrix onto the stack so that the 2d projection doesn't fark it up. Then, you use an ortho view set to whatever coordinates you need. After that, it's pretty straightforward. I've just added a few nice touches (like the
T2dTo3dSwitch and T3dTo2dSwitch classes).

The example is totally straightforward: it just draws a texture somewhere on the screen at the given coordinates, as if you were doing a 2d draw (this happens in TPlayingGameState.Update, probably). It's pretty easy to get the idea of what it's doing, I hope.

Anyway, feel free to comment on it if you feel a bit lost or if you notice something noteworthy.