|
发表于 2011-4-12 12:13:00
|
显示全部楼层
Re:FlowControl问题
完整测试示例
using namespace hgl;
class Blue:public FlowObject
{
public:
void Draw()
{
glClearColor(0,0,1,1);
ClearScreen();
}
};//class Blue
class Red:public FlowObject
{
public:
void Draw()
{
glClearColor(1,0,0,1);
ClearScreen();
}
};//class Red
class GameControl:public FlowControl
{
bool MouseLeftDoubleClickProc(int,int,uint)
{
Exit(new Red);
return(true);
}
public:
GameControl(FlowObject *obj)
{
SetStart(obj);
SetEventCall(OnMouseLeftDoubleClick,this,GameControl,MouseLeftDoubleClickProc);
}
void Update()
{
ProcCurState();
}
};//class GameControl
void GameMain(int,wchar_t**)
{
SystemInitInfo sii;
GameApplication app;
sii.info.ProjectName=L"自定义流程控制器";
sii.info.ProjectCode=L"Customize FlowControl";
if(!app.Init(&sii))
return;
app.SetStart(new GameControl(new Blue));
app.Run();
} |
|