Matt's Source Code Portal

Home About Links Problems My Graphics BaseCode Contact

Compiling

All Visual C++ zip's contain a *.sln file, which should be the file opened with Visual Studio .NET, and a *.dsw file, which should be opened if you want to use Visual Studio 6.0 (and perhaps earlier.) The projects are all Win32 applications, and contain only the 4 source files listed on the previous page (the rest of the source is #included.) The Engine folder is universal throughout all of my applications, and can be moved to some general directory on the include path for later use (although nothing keeps you from using a different Engine folder for every project.)

In Main.h you can enable or disable several features by commenting or uncommenting the #defines there. This will enable you to use the BaseCode even if you don't have the DirectX SDK installed, for example. Various versions of the code with certain elements (both library and source) excluded from the build can be gotten here:

x DirectX, OpenGL, and Software
x DirectX and Software only
x OpenGL and Software only
x Software only

Linking

Windows, DirectX, and OpenGL all have seperate library requirements. Furthermore, Visual Studio .NET will automatically include some core libraries that Visual Studio 6.0 will not. Even more annoying, the DirectX headers will include some libraries automatically as well. The result is a mess of libraries. Where appropriate, I provide my own copies of the libraries I use; libraries that come with Windows shouldn't be transferred between computers (and you should have them already or something's wrong.) In all cases, my code is 32-bit; changes will have to be made to get it to compile on a 64-bit system.
To change the libraries .NET links with, go to File -> Properties -> Linker -> Input -> Additional Dependencies...
The VC++ 6.0 equivalent is project -> settings-> Link Object / library modules

Base Windows Libraries

x winmm.lib, used for its timer functions
x vfw32.lib, used for screen capture
x kernel32.lib
x user32.lib
x advapi32.lib

The last three libraries are automatically included in the DirectX headers and by Visual Studio .NET, and thus are not explicitly included in the additional dependencies line.

DirectX Libraries

It should be possible to run the DirectX code without installing the SDK by directly linking my versions, however I advise just getting the most recent copies of the libraries straight from Microsoft.

xd3d9.lib
xd3dx9dt.lib (for Visual Studio .NET only)
xd3dx9.lib (for VC++ 6.0 only)
xDShow.lib (this is only if you want to use video files as textures. You will probably need to get this from me, as it's part of an older version of the DirectX SDK. Current copies of the DirectX SDK do not contain DirectShow.)

OpenGL Libraries

xopengl32.lib (this should come with your graphics card.)
xglaux.lib (this is only for loading bitmaps into OpenGL textures, but is not OpenGL standard, so you will also probably need to get it here.)

If everything works, the following 640x480 window with a rotating sphere inside it should come up:

If everything works