Tutorial 1


For the first tutorial there will be no code. Yeah I know, boring.... but a few bits and bobs need to be sorted out before actually writing any.

This information has all been published before on virtually every Glide 2.x tutorial site out there and it's thanks to those sites that I found out in the first place so if you've read this before, skip straight to the second tutorial.

Setting Up The Compiler

This information is for Microsoft Visual C++ v5, for other compilers you will have to use your loaf a bit, but it will be similar I'm sure.

I'll be making console applications, the reason for this is that I'm a useless programmer and I hate programming for Windows, console apps behave much more like DOS which I'm more comfortable with. As a result of this the programs won't work with Voodoo Rush cards (although if anyone wants to send in Rush compatible code, I'll certainly consider putting it up).

So, create a new workspace for a console application.

From the Tools menu, select Options and under the Directories section add two new entries for Include and Lib so that the compiler knows where to find the .h and .lib files, The paths will be something like this:

\3DFX\SDK\GLIDE3X\INCLUDE

and

\3DFX\SDK\GLIDE3X\LIB\WIN32

Next go to the Settings option from the Build menu and in the list of preprocessor definitions add __MSC__ (with two underscores either side) or you'll get an error saying that #warning isn't a valid directive in one of the include files.

Finally in the Link section add glide3x.lib to the list of object files.

I can compile stuff perfectly well with this setup but The Black Art of 3DFX Programming website recommends also reducing the compiler warning level to 1, changing the code generation processor type from Blend to Pentium and changing the calling convention from __CDECL* to __STDCALL. I've found it works both ways. Anybody?

VC5 is now set up for console Glide applications.

Read Some Stuff

At this point I recommend you read the first three chapters from the Glide 3.0 Programming Guide. Pay particular attention to the following topics:

You may also want to quickly take a look at Chapter 4 but don't worry if it doesn't make much sense yet.

In the next tutorial we'll be putting the information contained in Chapters 3 and 4 to use by making a very simple program which simply demonstrates how to use some basic drawing primitives.