|
GAME PROGRAMMING RESOURCES
<< BACK
|
|
|
USING 3IMPACT AS A DLL VISUAL C++ 6.0 STEP-BY-STEP
Register
3Impact game engine, download the distribution file and install it.
Run Microsoft Visual C++ 6.0 and select File -> New... from the
pull-down menu, select Project tab.
Select Win32 Application project type and name the new
project 3ImpactApp.
Make sure the Location is the folder named 3impact5. This
is the main folder for the engine and it is typically installed inside the
C:\Program Files folder. Click OK to continue.
On the next screen, select the A simple Win32 application radio button
and then click the Finish button. Click OK on the subsequent
screen to confirm.
Close Visual C++ and browse your hard disk to the
C:\Program Files\3impact5\3Impact_as_a_DLL\VCPP
folder.
Select all the files in the folder and copy (Ctrl+C) them.
Browse to your newly created project folder
C:\Program Files\3impact5\3impactApp
and paste (Ctrl+V) the files there. Confirm that you want to
overwrite the existing 3ImpactApp.cpp file.
Run Visual C++ again, open the newly create 3ImpactApp workspace,
select the File View tab and open the 3ImpactApp files tree.
Right-click the yellow Source Files folder,
select Add Files to Folder...
and then double-click the 3ImpactCode.cpp file.
Then right-click the yellow Header Files folder,
select Add Files to Folder...
and then double-click the dll3Impact.h file.
Select Project -> Settings... from the
pull-down menu, select the Debug tab and type
C:\PROGRAM FILES\3IMPACT5\3ImpactWork\3ImpactApp.exe
as executable for debug session and
C:\PROGRAM FILES\3IMPACT5\3ImpactWork\
as working directory.
Select the Link tab and and type
C:\PROGRAM FILES\3IMPACT5\3ImpactWork\3ImpactApp.exe
as output file name.
Add dll3impactd.lib to the Object/library modules list.
Then switch to Win32 Release settings (see top/left of dialog box)
and set executable for debug session, working directory and output file name
to the same paths used for the Win32 Debug settings, but make sure you
add the re-distributable
dll3impact.lib
library version to the Object/library modules list, and not the
dll3impactd.lib, which is intended for developing purposes only and cannot
be re-distributed.
The project is now ready to be compiled.
The 3ImpactApp.cpp file is an example implementing the main program loop.
See the comments in the code for details.
The 3ImpactCode.cpp is the actual game.
See the comments in the code for details.
COMPILING CODE EXAMPLES WITH THE DLL VERSION OF 3IMPACT GAME ENGINE
A number of demos is available as commented source code in the
C:\Program Files\3impact5\3ImpactDLL
folder.
For each example, the code in the 3ImpactDLL.cpp can be used
in place of the 3ImpactCode.cpp in the 3ImpactApp project created
as described above.
So, simply copy the entire .cpp code of each example to the
3ImpactCode.cpp (replacing all existing code), remove all
the #include lines at the top of the code and replace them
with the following:
#include "stdafx.h"
#define _3IMPACT_EXTERN
#define WIN32DLL_API __declspec(dllimport)
#define CALLMODE_API
#include "dll3impact.h"
Compile and run.
|
|