本文整理汇总了C++中CScene::PrepareAnimation方法的典型用法代码示例。如果您正苦于以下问题:C++ CScene::PrepareAnimation方法的具体用法?C++ CScene::PrepareAnimation怎么用?C++ CScene::PrepareAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CScene
的用法示例。
在下文中一共展示了CScene::PrepareAnimation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: winproc
//.........这里部分代码省略.........
/// wygaœ odpowiednie opcje w menu:
ZeroMemory(&mii, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STATE;
mii.fState = MFS_GRAYED;
::SetMenuItemInfo(hMenu, ID_MENU_VIEW_ANIMATION, FALSE, &mii);
::SetMenuItemInfo(hMenu, ID_MENU_FILE_CLOSE, FALSE, &mii);
/// umieœæ w titlebarze sam¹ nazwê aplikacji:
DELETE_ARRAY(g_lpszProgName);
g_lpszProgName = strdup(g_lpszNoFileProgName);
::SetWindowText(hWnd, g_lpszProgName);
}
break;
case ID_MENU_FILE_EXIT:
g_Scene.Release();
::SendMessage(hWnd, WM_CLOSE, 0, 0);
break;
case ID_MENU_VIEW_ANIMATION: {
if (!DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG1), MainhWnd, (DLGPROC)SetupDlgProc))
return 0;
if (g_WindowParams.szTitle == NULL)
g_WindowParams.szTitle = strdup("test");
g_WindowParams.lpfnProc = MainWndProc;
g_WindowParams.hInst = g_hInstance;
try {
if (!g_Scene.SetActiveCamera("Camera01"))
g_Scene.SetFirstCamera();
::EnableWindow(hWnd, FALSE);
InitOpenGL(g_WindowParams, hWnd);
g_Scene.SetScreenAspect((float)g_WindowParams.nWidth/g_WindowParams.nHeight);
//g_Scene.PrintInfo(LOG);
g_Scene.PrepareAnimation();
g_Scene.InitTextures();
g_Scene.InitDisplayLists();
PlayAnimation();
g_Scene.DeinitDisplayLists();
g_Scene.DeinitTextures();
DeInitOpenGL(g_WindowParams);
::EnableWindow(hWnd, TRUE);
::SetActiveWindow(hWnd);
} catch (CException ex) {
if (ex.type == CException::EXCEPTION_STRING) {
static char *error_msg = strdup(ex.error_string);
fatal_error(error_msg);
} else {
char buffer[10];
_itoa(ex.error, buffer, 10);
fatal_error(buffer);
}
} catch (...) {
fatal_error("Unknown error!");
}
} break;
case ID_MENU_HELP_ABOUT:
::DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), MainhWnd, (DLGPROC)AboutDlgProc);
break;
default:
break;
}
break;
case WM_DESTROY:
::PostQuitMessage(0);
break;
case WM_CREATE:
ZeroMemory(&mii, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STATE;
mii.fState = MFS_GRAYED;
::SetMenuItemInfo(hMenu, ID_MENU_VIEW_ANIMATION, FALSE, &mii);
::SetMenuItemInfo(hMenu, ID_MENU_FILE_CLOSE, FALSE, &mii);
break;
default:
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
break;
}
return 0;
}