本文整理汇总了C++中CMouse::SetHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ CMouse::SetHandle方法的具体用法?C++ CMouse::SetHandle怎么用?C++ CMouse::SetHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMouse
的用法示例。
在下文中一共展示了CMouse::SetHandle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
//.........这里部分代码省略.........
if(con.LoadAssetFile(cfg.FrameworkAssetFile) == false){
pLog->Log("Failure loading " + cfg.FrameworkAssetFile);
::MessageBox(hWnd,"Failed to load editor.dat file", "Error", 0);
return 0;
}
else
pLog->Log(cfg.FrameworkAssetFile + " (frame graphics) was loaded successfully!");
//load game play assets
if(con.LoadAssetFile(cfg.GamePlayAssetFile) == false){
pLog->Log("Failure loading " + cfg.GamePlayAssetFile);
::MessageBox(hWnd,"Failed to load assets.dat file", "Error", 0);
return 0;
}
else
pLog->Log(cfg.GamePlayAssetFile + " (game play graphics) was loaded successfully!");
//load objects
//***************************************************************************
if(gameData.LoadObjectFile(cfg.GameObjectFile) == false){
pLog->Log("Failure loading " + cfg.GameObjectFile);
//::MessageBox(hWnd,"Failed to load objects.dat file", "Error", 0);
// return 0;
}
else{
pLog->Log(cfg.GameObjectFile + " (objects file) was loaded successfully!");
// for(int i = 0; i < gameData.m_catalog.GetTableSize();++i){
// pLog->Log("object", gameData.m_catalog.GetTerm(i, 0), gameData.m_catalog.GetTerm(i, 2));
// }
}
gTimerKey.Initialize();
gTimerKey.ResetTimer();
mouse.SetHandle(hWnd);
gTimerFPS.Initialize();
//game timer for update
CTimer timerGame;
timerGame.Initialize();
//define events for changing game states
//*************************************************************************
//g_pStateIntro->AddTransitionEvent(EVENT_GO_PLAY1, g_pStatePlay1);
//g_pStatePlay1->AddTransitionEvent(EVENT_GO_CREDITS, g_pStateCredits);
g_pStateIntro->AddTransitionEvent(EVENT_GO_MAIN, g_pStateMain);
g_pStateMain->AddTransitionEvent(EVENT_GO_PLAY1, g_pStatePlay1);
g_pStateMain->AddTransitionEvent(EVENT_GO_HELP, g_pStateHelp);
g_pStateMain->AddTransitionEvent(EVENT_GO_CREDITS, g_pStateCredits);
g_pStatePlay1->AddTransitionEvent(EVENT_GO_QUIT, g_pStateQuit);
//g_pStatePlay1->AddTransitionEvent(EVENT_GO_MAIN, g_pStateMain);
g_pStateHelp->AddTransitionEvent(EVENT_GO_MAIN, g_pStateMain);
g_pStateCredits->AddTransitionEvent(EVENT_GO_QUIT, g_pStateQuit);
g_pCurrent = g_pStatePlay1;// g_pStateIntro;
// enter the main loop
//************************************** M A I N L O O P *****************
MSG msg;
pLog->Log("Entering Main Control Loop");
float timeDiff = 0.0f;
g_pCurrent->Activate(gameData, cfg, con);
while(g_bRunning)
{