Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

main.cpp

Go to the documentation of this file.
00001 
00006 /*
00007 #ifndef WIN32

00008 #include <sys/types.h>

00009 #include <sys/stat.h>

00010 #include <fcntl.h>

00011 #include <unistd.h>

00012 #endif 

00013 */
00014 #ifdef WIN32
00015 #pragma warning (disable : 4786)
00016 #include <windows.h>
00017 #endif 
00018 
00019 #include "SDLCanvas.h"
00020 #include "SDLKeyboardDevice.h" 
00021 #include "SDLRenderTools.h"
00022 #include "SDLSystem.h"
00023 #include <SDL/SDL_main.h>
00024 // common stuff for stand-alone gameplayers
00025 #include "GPC_Init.h"
00026 #include "TerraplayDeviceInterface.h"
00027 
00028 // view SDL_main.h for next line
00029 extern "C" main(int argc, char *argv[])

00030 {
00031         // SDL specific
00032         // allocate an input device, derived from pure virtual KX_IInputDevice
00033         //SDLInputDevice *inputdev = new SDLInputDevice();
00034         SDLInputDevice *inputdev = new SDLKeyboardDevice();//SDLInputDevice();
00035         
00036         
00037         // first the system (to compare: normally created within Blender)
00038         SCA_ISystem *sca_system = NewSDLSystem();
00039         
00040         sca_system->SetKeyboardDevice(inputdev);
00041         
00042         RAS_ICanvas *canvas = new SDLCanvas();
00043         RAS_IRenderTools *rendertools = new SDLRenderTools();
00044         
00045         RAS_IRasterizer* rasty_rostelly = CreateRasterizer(canvas);
00046         KX_GameObject* geemobject = CreateGameObject(rasty_rostelly);
00047         SND_IScene* sndscene = CreateSoundScene();
00048         
00049         PyObject* pythondict = CreatePythonBindings("glutplayer",canvas);
00050 
00051         NG_NetworkDeviceInterface* terraplaydevice = new TerraplayDeviceInterface();
00052         
00053         SCA_LogicManager* logicmgr = CreateSampleLogic(inputdev, geemobject,sndscene,pythondict,terraplaydevice);
00054         
00055         // the scene creation consists for now only adding one (1) single gameobject
00056         // later on, we have a file importer, and a converter that traverses the
00057         // file import stuff into known data
00058         
00059         SCA_IMainLoop* mymainloop = CreateEngine(rasty_rostelly,canvas,
00060                 rendertools,
00061                 sndscene,
00062                 logicmgr,
00063                 geemobject);
00064         
00065         // be sure that everything (including logicmanager) is called each frame
00066         
00067         sca_system->SetMainLoop(mymainloop);
00068         sca_system->StartMainLoop();
00069         
00070         DestructPythonBindings();
00071         
00072         
00073         return 0;
00074 }
00075 
00076 

Generated at Thu Feb 1 13:03:07 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000