Tutorial 1a : First things first |
Introduction To successfully write a Glide application using Visual C++, there are a few simple things that we must first do. These are:
The Glide SDK, or Software Development Kit, contains all of the necessary files for developing a Glide application. As well as the Glide libraries and header files, it also has extensive documentation. The full kit is split into three sections - the SDK itself (including documentation), diagnostics and a separate documentation package - and is available free of charge from the 3dfx web site. Note: the paths given here are those used by the release from the 2nd of July 1998. If you are using a different version, the directory structure may be different. Install the Glide runtime library You probably have the Glide runtime library already installed on your machine, but if not you must do so before writing any programs. The library is what allows your programs to talk to the Voodoo card, and without it they will not work. You can download the runtime library reference drivers from the 3dfx web site, or card-specific drivers should be available from your 3D card manufacturer's web site. Tell the compiler where the Glide header and library files are located
We now need to let the compiler know where certain files are located. Go into Developer Studio and select the Tools
Click on the "new" button (dotted rectangle with a yellow spark) and then click on the "browse" button (three dots) that has appeared at the bottom of the directory list. In the directory window that pops up, find the directory where you installed the Glide SDK and then find the subdirectory:
Now change the "Show directories for" option to "Library files" and add a new directory in the same way as you did for the header files. The subdirectory you want to add this time is:
Note: we only need to specify these settings once, not for every new project. Create a suitable project workspace
Select the File
For the purposes of our first few tutorials, create a console application with the name tutor_1, or whatever name you would rather use. The "New Project Workspace" window will close when you click on OK, and the workspace will have been created, ready for us to start writing our program. Tell the Glide header files that we're using a Microsoft compiler
The Glide header files behave slightly differently depending on what sort of compiler we're using. To tell them that we're using a Microsoft compiler, select the Build
The "Preprocessor Definitions" text box will be set to:
Tell the compiler to load the Glide library file We write a Glide program by calling several functions that have already been written for us. These functions are contained in the Glide library file, so we need to let the compiler know where it is. Because we've already specified the directory that contains the Glide library files, we only need to tell the compiler what the name of the file is.
To do this, change to the "Link" tab in the "Project Settings" window, as shown in Figure 4. The "Object / Library modules" text box contains a list of all the library files that we want to have available to our program. Add the name of the Glide library file, "glide2x.lib", to the beginning of the list and then click the OK button.
We must also remember to include the Glide header files in any source files that need access to the library routines. Remember that the primary header file (the only one that we need to include, although it will include others itself) lives in one of our specified "Include files" directories, not in our project directory, so angle brackets should be used in the #include directive, thus:
The compiler now knows where the Glide header and library files are and the header files know that we're using a Microsoft compiler. That's all there is to it! Our new project workspace is now ready for us to start writing some code. Next Tutorial | Main Page This tutorial is ©1998 by Andrew Smith. No part of this tutorial may be reproduced without permission. If you want to reproduce any of this tutorial for non-commercial purposes then I'm not likely to try and stop you, but please ask me first. |