92 lines
2.3 KiB
C
92 lines
2.3 KiB
C
|
/** \file simplegameapplication.h
|
|||
|
* \brief <EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
|||
|
* Copyright (c) 2011,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>WebJet<EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>
|
|||
|
* All rights reserved.
|
|||
|
* Date Ver Who Comment
|
|||
|
* 2011:7:20 1.0 <EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD>
|
|||
|
*/
|
|||
|
#ifndef __simplegameapplication_H__
|
|||
|
#define __simplegameapplication_H__
|
|||
|
|
|||
|
#include "appframework/feature_fwd_decl.h"
|
|||
|
#include "appframework/gameapplication.h"
|
|||
|
#include "basegamefeature/basegamefeature.h"
|
|||
|
#include "graphicfeature/graphicsfeature.h"
|
|||
|
#include "inputfeature/inputfeature.h"
|
|||
|
#include "foundation/framesync/framesynctimer.h"
|
|||
|
#include "input/inputwindowsource.h"
|
|||
|
#include "vegetationfeature/vegetationfeature.h"
|
|||
|
#include "guifeature/gui.h"
|
|||
|
//------------------------------------------------------------------------------
|
|||
|
namespace Sample
|
|||
|
{
|
|||
|
class SimpleGameApplication : public App::GameApplication
|
|||
|
{
|
|||
|
__DeclareThreadSingleton(SimpleGameApplication);
|
|||
|
public:
|
|||
|
/// constructor
|
|||
|
SimpleGameApplication();
|
|||
|
/// destructor
|
|||
|
virtual ~SimpleGameApplication();
|
|||
|
|
|||
|
/// open the application
|
|||
|
virtual bool Open();
|
|||
|
|
|||
|
virtual void Close();
|
|||
|
|
|||
|
///
|
|||
|
virtual void Run(void);
|
|||
|
|
|||
|
const Ptr<Input::InputWindowSource>& GetInputWindowsSource(void) const;
|
|||
|
|
|||
|
public:
|
|||
|
void SetMonoDebug(bool debug);
|
|||
|
protected:
|
|||
|
/// setup application state handlers
|
|||
|
virtual void SetupStateHandlers();
|
|||
|
/// setup game features
|
|||
|
virtual void SetupGameFeatures();
|
|||
|
/// cleanup game features
|
|||
|
virtual void CleanupGameFeatures();
|
|||
|
/// <20><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
virtual void SetupProjectAssigns();
|
|||
|
|
|||
|
private:
|
|||
|
Ptr<App::GraphicsFeature> mGraphicsFeature;
|
|||
|
Ptr<App::GraphicObjectManager> mGraphicObjectManager;
|
|||
|
Ptr<App::BaseGameFeature> mBaseGameFeature;
|
|||
|
Ptr<App::InputFeature> mInputFeature;
|
|||
|
App::TParticleFeaturePtr mParticleFeature;
|
|||
|
|
|||
|
|
|||
|
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>InputSource
|
|||
|
Ptr<Input::InputWindowSource> mInputWindowsSource;
|
|||
|
HWND mWnd;
|
|||
|
Ptr<App::GUIServer> mGuiServer;
|
|||
|
bool mMonoDebug;
|
|||
|
};
|
|||
|
//------------------------------------------------------------------------
|
|||
|
inline
|
|||
|
const Ptr<Input::InputWindowSource>&
|
|||
|
SimpleGameApplication::GetInputWindowsSource(void) const
|
|||
|
{
|
|||
|
return mInputWindowsSource;
|
|||
|
}
|
|||
|
|
|||
|
inline void SimpleGameApplication::SetMonoDebug(bool debug)
|
|||
|
{
|
|||
|
mMonoDebug = debug;
|
|||
|
}
|
|||
|
|
|||
|
} // namespace Test
|
|||
|
//------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#endif // __simplegameapplication_H__
|
|||
|
|