|
Installing the library
After downloading the library, it can be installed wherever you want;
however, I suggest you install it where you installed your programming software
(i.e. where Visual Studio is installed). The installation folder can be moved
anywhere on your hard drive since there is no information that is put into your
system registry. However, once you've set up Visual Studio to use the library,
you should not move it anymore.
Setting up Visual Studio to use the library
This is a one-time process where we let Visual Studio know where the header
and library files are located so that projects using it will compile properly.
Do the following:
 | Select "Tools->Options..." and select the "Directories" tab. |
 | Set "Show directories for:" to "Include files" and add the path to the "include" folder of the
library. |
 | Set "Show directories for:" to "Library files" and add the path to the "lib"
folder. |
Creating a Win32 project to use the library
The following steps must be followed in order to create a standard Win32
application that uses the library. This is what you would use for the actual
game engine.
There are two different types of lib files - one for Debug and one for Release. We need to
set up the project to compile with the correct version of the lib file as
follows:
 | Select "Project->Settings..." and make sure your project is selected in
the left-most window. |
 | Select the "Link" tab. |
 | Set "Settings For:" to "Win32 Debug" and add "gsdxlib_debug.lib"
to the "Object/library modules" edit box. |
 | Set "Settings For:" to "Win32 Release" and add "gsdxlib.lib"
to the "Object/library modules" edit box. |
To ensure MFC compatibility, we need to change the project settings so that it compiles with
the multi-threaded DLL libraries in Debug. Even if you are not using MFC, this
needs to be done or there will be linker conflicts:
 | Select "Project->Settings..." and make sure your project is selected in
the left-most window. |
 | Select the "C/C++" tab and select "Code Generation" from the "Category" pull-down menu. |
 | Set "Settings For:" to "Win32 Debug". |
 | From the "Use run-time library" pull-down, select "Debug Multithreaded DLL" |
Now your project is set up to use the library and all it's functionality. All
you need to do is place "#include <gs_lib.h>" anywhere in your
code.
Creating an MFC project to use the library
|