00001 00002 00003 #define EXPERIMENTAL_SOUND 00004 00005 00006 #include <fcntl.h> 00007 00008 // our custom glut wrapping classes 00009 #include "GlutCanvas.h" 00010 #include "GlutSystem.h" 00011 #include "GlutKeyboardDevice.h" 00012 #include "GlutRenderTools.h" 00013 //#include "GlutPolygonMaterial.h" 00014 // common stuff for stand-alone gameplayers 00015 #include "GPC_Init.h" 00016 00017 00018 const MT_Scalar UpperBoundForFuzzicsIntegrator = 0.01; // At least 100Hz (isn't this CPU hungry ?) 00019 00020 00021 int main() 00022 { 00023 KX_GlutInputDevice* inputdeva = new GlutKeyboardDevice(); 00024 SCA_ISystem* sca_system = NewGlutSystem(); 00025 00026 sca_system->SetKeyboardDevice(inputdeva); 00027 00028 RAS_ICanvas *canvas = new GlutCanvas(); 00029 RAS_IRenderTools *rendertools = new GlutRenderTools(); 00030 // general player stuff 00031 00032 RAS_IRasterizer* rasty_rostelly = CreateRasterizer(canvas); 00033 KX_GameObject* geemobject = CreateGameObject(rasty_rostelly); 00034 SND_IScene* sndscene = CreateSoundScene(); 00035 00036 PyObject* pythondict = CreatePythonBindings("glutplayer",canvas); 00037 00038 SCA_LogicManager* logicmgr = CreateSampleLogic(inputdeva,geemobject,sndscene,pythondict); 00039 00040 // the scene creation consists for now only adding one (1) single gameobject 00041 // later on, we have a file importer, and a converter that traverses the 00042 // file import stuff into known data 00043 00044 SCA_IMainLoop* mymainloop = CreateEngine(rasty_rostelly,canvas, 00045 rendertools, 00046 sndscene, 00047 logicmgr, 00048 geemobject); 00049 00050 // be sure that everything (including logicmanager) is called each frame 00051 00052 sca_system->SetMainLoop(mymainloop); 00053 sca_system->StartMainLoop(); 00054 00055 DestructPythonBindings(); 00056 return 0; 00057 }