A Quick OpenGL Tutorial Platform: Multi-platform

Welcome to my OpenGL tutorial! Recently, with the appearance of high-performance 3D graphics cards on the PC, 3D applications are no longer delegated to the realm of the expensive custom workstation. For a C programmer, this means more than games – 3D is already being used in hundreds of application areas which previously were somewhat… flat.

The de-facto standard for a 3D api for many years was OpenGL, originally made by SGI. Unfortunetly, when it came time to port OGL over to the PC platform to take advantage of the new accelerated graphics cards, Microsoft was hard at work at it's own 3D standard-Direct3D. The result was that MS dragged its feet somewhat and released a somewhat shoddy software-only port of OpenGL on Windows 95. SGI also released a software-only version which takes advantage of acceleration techniques such as the MMX instruction set, and many card manufactures (such as those that use the 3Dfx chipset) provide their own drivers for interfacing with their boards. Unfortunetly, Microsoft has made it clear by their actions that Direct3D will be the only api they will support for Windows 95 (and the upcoming Windows 98).

So where does that leave us, the development community? Well, you could learn Direct3D…the process of which has several drawbacks: Firstly, Direct3D is by far the most horridly designed 3D api that has ever existed. Also, since it is built on top of DirectDraw, you must also learn that library before you can even begin D3D work. In addition, if you don't know how to interface to COM libraries (which in itself is no joy from C), that's another learning curveball thrown your way. Finally, there is the obvious fact that Direct3D only works for Win95, so cross-platform development is out of the question. If you want the full story on the horrors of Direct3D, you can check out a D3D tutorial at http://www.wksoftware.com/publications/d3dim.html.

Anyway, this tutorial is intended for C (or C++) programmers who have a moderate to strong grasp of the language. There is no 3D experience required to learn OpenGL, although it could help make some of the concepts clearer. One of the nice things about OpenGL is that it's easy to use – the interface is straightforward with no excess baggage. Likewise rather than use COM to provide an object-oriented paradigm in both C and C++, OpenGL is implemented as C functions which can be organized in any manner you see fit. There are good C++ encapsulations of OpenGL availible, but in this tutorial I'm just going over the basics, so I won't hide the interface. Now on that note, lets get started.

Загрузка...