main.cpp

00001 
00002 #include "main.h"
00003 #include "irrlichtWrapper.h"
00004 #include "physxWrapper.h"
00005 #include "controler.h"
00006 
00007 
00008 // global used symbols for graphics
00009 IrrlichtDevice*         device          = NULL;
00010 IVideoDriver*           driver          = NULL;
00011 ISceneManager*          smgr            = NULL;
00012 IGUIEnvironment*        guienv          = NULL;
00013 ILogger*                        logger          = NULL;
00014 ITimer*                         timer           = NULL;
00015 
00016 // global used symbols for physics
00017 NxPhysicsSDK*           nxSDK           = NULL;
00018 NxScene*                        nxScene         = NULL;
00019 
00020 
00021 
00022 void main()
00023 {
00024         ERR_TYPE status = ERR_OK;
00025 
00026         status = irrlichtInit();
00027         if ( ERR_OK != status )
00028         {
00029                 printf("irrlicht not found\n");
00030                 goto HELL;
00031         }
00032 
00033         status = physxInit();
00034         if ( ERR_OK != status )
00035         {
00036                 printf("physx not found\n");
00037                 goto HELL;
00038         }
00039 
00040         status = controlerInit();
00041         if ( ERR_OK != status )
00042         {
00043                 printf("controler not found\n");
00044                 goto HELL;
00045         }
00046 
00047         while ( ERR_OK == status )
00048         {
00049                 // physX: simulate
00050                 status = physxUpdate();
00051                 if ( ERR_OK != status )
00052                 {
00053                         break;
00054                 }
00055 
00056                 // handle events
00057                 // apply transformation of all objects from physics simulation to graphics renderer
00058                 status = controlerUpdate();
00059                 if ( ERR_OK != status )
00060                 {
00061                         break;
00062                 }               
00063                 
00064                 // irrlicht: draw
00065                 status = irrlichtUpdate();
00066                 if ( ERR_OK != status )
00067                 {
00068                         break;
00069                 }
00070         }
00071 
00072         status = controlerDeinit();
00073         status = physxDeinit();
00074         status = irrlichtDeinit();
00075 
00076         return;
00077 
00078 HELL:
00079         // wait infinit until user recognized problem
00080         printf("\npress enter");
00081         getchar();
00082 }

Generated on Sun Dec 2 03:10:23 2007 for TableTop by  doxygen 1.5.4