本文整理汇总了C++中boost::intrusive_ptr::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ intrusive_ptr::Destroy方法的具体用法?C++ intrusive_ptr::Destroy怎么用?C++ intrusive_ptr::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::intrusive_ptr
的用法示例。
在下文中一共展示了intrusive_ptr::Destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
int APIENTRY WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR str, int nWinMode){
LOG_PREFIX("logs\\clientLog");
LOG_LEVEL(logger::Debug); // уровень лога в рантайме (например, берём из командной строки)
LOG_DEBUG << "WinMain starting..";
Scene=0; hDC=0;
int full=0; int WindowX=0; int WindowY=0; int Width=800; int Height=600;
full = GetPrivateProfileIntA("Options", "FullScreenEnable", 0, "Data/graph.ini");
WindowX = GetPrivateProfileIntA("Options", "WindowX", 0, "Data/graph.ini");
WindowY = GetPrivateProfileIntA("Options", "WindowY", 0, "Data/graph.ini");
Width = GetPrivateProfileIntA("Options", "Width", 800, "Data/graph.ini");
Height = GetPrivateProfileIntA("Options", "Height", 600, "Data/graph.ini");
Scene = new TScene();
if ( full == 0 ){
WNDCLASSA wcl;
wcl.hInstance = hThisInst;
wcl.lpszClassName = "OpenGLWinClass";
wcl.lpfnWndProc = WindowFunc;
wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
wcl.hIcon = NULL;
wcl.hCursor = LoadCursor(NULL,IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
// RegisterClassA(&wcl);
if ( !RegisterClassA(&wcl) ) return -1;//throw "RegisterClass";
hWnd = CreateWindowA("OpenGLWinClass", "Elt",WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WindowX, WindowY, Width, Height, NULL, NULL, hThisInst, NULL);
ShowWindow(hWnd, SW_SHOWNORMAL);
UpdateWindow(hWnd);
}
if ( full == 1 ){
DEVMODE ss;
WNDCLASSA wcl;
memset(&ss, 0, sizeof(ss) );
ss.dmSize = sizeof(ss);
ss.dmPelsWidth = Width;
ss.dmPelsHeight = Height;
ss.dmBitsPerPel = 32;
ss.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
if (ChangeDisplaySettings(&ss, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) MessageBoxA(NULL, "Ошибка в ChangeDisplaySettings", "Error", MB_OK | MB_ICONSTOP);
memset(&wcl, 0, sizeof(wcl) );
wcl.lpfnWndProc = (WNDPROC)WindowFunc;
wcl.hInstance = hThisInst;
wcl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcl.lpszClassName = "OpenGLWinClass";
if ( !RegisterClassA(&wcl) ) return -1;//throw "RegisterClass";
hWnd = CreateWindowA("OpenGLWinClass", "Elt", WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, Width, Height, NULL, NULL, hThisInst, NULL);
if ( !hWnd ) return -1;//throw "CreateWindow";
SetWindowPos( hWnd, HWND_TOPMOST, 0, 0, 0, 0, 1 );
ShowWindow(hWnd, SW_SHOWMAXIMIZED);
}
MSG msg;
LOG_DEBUG << "WinMain started end";
LOG_DEBUG << "World Init...";
World->Init();
LOG_DEBUG << "...End World Init";
//---network init
LOG_DEBUG << "netClient.Init()";
netClient.Init(World);
//World->SetNetStatData(&netClient.mNetStat);
netClient.SetTimeBetweenPacketsSend(500);
LOG_DEBUG << "netClient.Run()";
netClient.Run();
//---------------
tTick gTick;
gTick.Init(20);//50 раз в сек
LOG_DEBUG << "Start Main loop";
do{
if(PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ))
{
if( msg.message == WM_QUIT ) break;
TranslateMessage( &msg );
DispatchMessage ( &msg );
}
World->CDM(); // Center of Decision Making (Graphics + Logic)
gTick.Wait();//Зачем ждать? Перести в World->CDM() и если рано - не ждать а выходить
}while(!bGameOver);
LOG_DEBUG << "End Main loop";
LOG_DEBUG << "World->Destroy()";
World->Destroy();
//.........这里部分代码省略.........