本文整理汇总了C++中CGameObject::Uninitialize方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameObject::Uninitialize方法的具体用法?C++ CGameObject::Uninitialize怎么用?C++ CGameObject::Uninitialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameObject
的用法示例。
在下文中一共展示了CGameObject::Uninitialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadCursor
int APIENTRY _tWinMain
(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpszCmdLine, int nCmdShow)
{
timeBeginPeriod(1);
WNDCLASS wc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wc.hCursor = LoadCursor(hInstance, IDC_ARROW);
wc.hIcon = NULL;
wc.hInstance = hInstance;
wc.lpfnWndProc = WndProc;
wc.lpszClassName = _T("ShootingGame");
wc.lpszMenuName = NULL;
wc.style = NULL;
if(RegisterClass(&wc) == NULL){
return 0;
}
HWND mainWnd = CreateWindow(
wc.lpszClassName, _T("ShootingGame"),
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
CW_USEDEFAULT, CW_USEDEFAULT,
640, 480, NULL, NULL, hInstance, NULL );
RECT r1, r2;
GetClientRect(mainWnd, &r1);
GetWindowRect(mainWnd, &r2);
MoveWindow(mainWnd, r2.left, r2.top,
640 + ((r2.right - r2.left) - (r1.right - r1.left)),
480 + ((r2.bottom - r2.top) - (r1.bottom - r1.top)), FALSE);
CGameObject game;
CoInitializeEx(NULL, COINIT_MULTITHREADED);
game.Initialize(mainWnd, hInstance);
CSound::CreateDirectSound(mainWnd);
game.AppendObject(new CTaskHead(), 0, true);
game.AppendObject(new CTaskTail(), INT_MAX, true);
game.AppendObject(new CTitle(), 1, true);
ShowWindow(mainWnd, nCmdShow);
MSG msg;
while(TRUE){
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)){
if(msg.message == WM_QUIT) break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}else{
game.DoAllTasks();
}
}
game.Uninitialize();
CSound::ReleaseDirectSound();
CoUninitialize();
return 0;
}