Integration
I have a blog now, visit me >>here<< for latest updates!
Eine deutsche Version meines Blogs gibt es >>hier<< !
01. integration
"Fallin' boxes"
I'm not going to explain how to built any of the libraries, take a look into their FAQ, WIKI or whatever. I expect that you have a working library already.
We start with something simple and necessary: the initialisation of the dynamcs world. At first we create a game class that will hold all references to objects and provide necessary functions. That's the way the class should look like:
CGameWorld.h - Class:
|
Might look like it's pretty much but it isn't at all. Therefore the main file is pretty simple:
main.cpp - main function:
|
We just create a CGameClass object and let it run, when it's finished we destroy it. Simple, huh? The initialisation will be done within the CGameClass constructor and if the 'world' is destroyed the destructor will cleanup everything.
Let's begin with the constructor. It has to call both init functions and the createSceneObjects function. This function will create all the world objects. And we also set all the pointers to NULL, just to prevent invalid memory access.
CGameWorld.cpp - Constructor:
|
And the destructor (this one should be self-expanatory):
CGameWorld.cpp - Destructor:
|
CGameWorld.h - Class:
here some text |