148 lines
3.3 KiB
C
148 lines
3.3 KiB
C
|
/** \file: DemoPublishGameApplication.h
|
|||
|
* \brief: Export the game
|
|||
|
* Copyright (c) 2011,WebJet Enterprise Department.ChangYou
|
|||
|
* All rights reserved.
|
|||
|
* Date Ver Who Comment
|
|||
|
* 2011/10/28 1.0 SunHao
|
|||
|
*/
|
|||
|
|
|||
|
#ifndef _WEBWebSimpleGameApplication_H_
|
|||
|
#define _WEBWebSimpleGameApplication_H_
|
|||
|
#include "DemoPublish_GameApplication.h"
|
|||
|
|
|||
|
#include "appframework/gameapplication.h"
|
|||
|
#include "basegamefeature/basegamefeature.h"
|
|||
|
#include "graphicfeature/graphicsfeature.h"
|
|||
|
#include "inputfeature/inputfeature.h"
|
|||
|
#include "foundation/framesync/framesynctimer.h"
|
|||
|
#include "input/inputhardwaresource.h"
|
|||
|
#include "input/inputwindowsource.h"
|
|||
|
#include "DemoGameStateHandler.h"
|
|||
|
//------------------------------------------------------------------------------
|
|||
|
namespace DemoPublish
|
|||
|
{
|
|||
|
class DemoPublishGameApplication : public App::GameApplication
|
|||
|
{
|
|||
|
__DeclareThreadSingleton(DemoPublishGameApplication);
|
|||
|
public:
|
|||
|
/// constructor
|
|||
|
DemoPublishGameApplication();
|
|||
|
/// destructor
|
|||
|
virtual ~DemoPublishGameApplication();
|
|||
|
|
|||
|
/// open the application
|
|||
|
virtual bool Open();
|
|||
|
|
|||
|
|
|||
|
//inline Ptr<App::GraphicsFeature> GetGraphicsFeature(){return mGraphicsFeature;}
|
|||
|
|
|||
|
void SetWebVersion(bool bWebVersion,void* hWebWindow);
|
|||
|
|
|||
|
|
|||
|
virtual void Close();
|
|||
|
|
|||
|
///
|
|||
|
virtual void Run(void);
|
|||
|
|
|||
|
const Ptr<Input::InputWindowSource>& GetInputWindowsSource(void) const;
|
|||
|
|
|||
|
void End();
|
|||
|
|
|||
|
//<2F>趨dllĿ¼
|
|||
|
void SetResourceBaseDir(const char* sPath)
|
|||
|
{
|
|||
|
m_sResourceBaseDir = sPath;
|
|||
|
}
|
|||
|
|
|||
|
//<2F>趨<EFBFBD><E8B6A8>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>URL
|
|||
|
void SetResDownloadUrl(const char* sPath)
|
|||
|
{
|
|||
|
m_sResDownloadUrl = sPath;
|
|||
|
}
|
|||
|
|
|||
|
//<2F>趨<EFBFBD><E8B6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
void SetSceneName(const char* sSceneName)
|
|||
|
{
|
|||
|
m_sSceneName = sSceneName;
|
|||
|
}
|
|||
|
|
|||
|
//<2F>趨<EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
void SetPipeName(const char* sPipeName)
|
|||
|
{
|
|||
|
m_sPipeName = sPipeName;
|
|||
|
}
|
|||
|
|
|||
|
const char* GetPipeName()
|
|||
|
{
|
|||
|
return m_sPipeName.AsCharPtr();
|
|||
|
}
|
|||
|
|
|||
|
void SetGameResolution(unsigned int uGameWidth,unsigned int uGameHeight)
|
|||
|
{
|
|||
|
muGameWidth = uGameWidth;
|
|||
|
muGameHeight = uGameHeight;
|
|||
|
}
|
|||
|
|
|||
|
unsigned int GetGameWidth()
|
|||
|
{
|
|||
|
return muGameWidth;
|
|||
|
}
|
|||
|
|
|||
|
unsigned int GetGameHeight()
|
|||
|
{
|
|||
|
return muGameHeight;
|
|||
|
|
|||
|
}
|
|||
|
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:
|
|||
|
bool mbWebVersion;
|
|||
|
void* mhWebWindow;
|
|||
|
unsigned int muGameWidth;
|
|||
|
unsigned int muGameHeight;
|
|||
|
|
|||
|
Ptr<App::GraphicsFeature> mGraphicsFeature;
|
|||
|
Ptr<App::GraphicObjectManager> mGraphicObjectManager;
|
|||
|
Ptr<App::BaseGameFeature> mBaseGameFeature;
|
|||
|
Ptr<App::InputFeature> mInputFeature;
|
|||
|
|
|||
|
Ptr<Demo::DemoGameStateHandler> gameState;
|
|||
|
|
|||
|
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>InputSource
|
|||
|
Ptr<Input::InputWindowSource> mInputWindowsSource;
|
|||
|
HWND mWnd;
|
|||
|
HWND mExternWnd;
|
|||
|
|
|||
|
//<2F><>Դ<EFBFBD><D4B4><EFBFBD>õĻ<C3B5><C4BB><EFBFBD>Ŀ¼
|
|||
|
Util::String m_sResourceBaseDir;
|
|||
|
//<2F><>Դ<EFBFBD><D4B4><EFBFBD>صĻ<D8B5><C4BB><EFBFBD>url
|
|||
|
Util::String m_sResDownloadUrl;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
Util::String m_sSceneName;
|
|||
|
//Packet Pipe
|
|||
|
Util::String m_sPipeName;
|
|||
|
|
|||
|
|
|||
|
};
|
|||
|
//------------------------------------------------------------------------
|
|||
|
inline
|
|||
|
const Ptr<Input::InputWindowSource>&
|
|||
|
DemoPublishGameApplication::GetInputWindowsSource(void) const
|
|||
|
{
|
|||
|
return mInputWindowsSource;
|
|||
|
}
|
|||
|
|
|||
|
} // namespace Test
|
|||
|
//------------------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#endif
|