| #ifndef APP_H
#define APP_H
#include <physicallayer/entity.h>
#include <physicallayer/pl.h>
/*
* Our main application class inherits from csApplicationFramework
* and csBaseEventHandler.
*/
class MainApp : public csApplicationFramework,
public csBaseEventHandler
{
private:
// References to modules from Crystal Space.
csRef<iGraphics3D> g3d;
csRef<iEngine> engine;
csRef<iLoader> loader;
csRef<iVFS> vfs;
csRef<iVirtualClock> vc;
csRef<iKeyboardDriver> kbd;
// References to modules from Crystal Entity Layer.
csRef<iCelPlLayer> pl;
csRef<iCelBlLayer> bl;
// Our level and player entity.
csRef<iCelEntity> level_entity;
csRef<iCelEntity> player_entity;
// Inherited from csBaseEventHandler: handle a keyboard event.
bool OnKeyboard (iEvent&);
// Inherited from csBaseEventHandler: handle a signle frame.
void ProcessFrame ();
// Inherited from csBaseEventHandler: handle a signle frame.
void FinishFrame ();
// Create the level entity and load the level in it.
// Returns false on failure. The error has been already reported to
// the reporter in that case.
bool LoadLevel ();
// Create the player.
// Returns false on failure. The error has been already reported to
// the reporter in that case.
bool CreatePlayer ();
public:
MainApp ();
virtual ~MainApp ();
// Inherited from csApplicationFramework: initialization.
virtual bool OnInitialize (int argc, char* argv[]);
// Inherited from csApplicationFramework: initialization.
virtual bool Application ();
};
#endif
|