int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { CommandLine()->CreateCmdLine( Plat_GetCommandLine() ); // TODO: Place code here. SpewOutputFunc( D3DAppSpewFunc ); MathLib_Init( true, true, true, 2.2f, 2.2f, 0.0f, 2.0f ); MSG msg; HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); strcpy( szWindowClass, "d3dapp" ); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_TERRAINBLEND); InvalidateRect( g_hWnd, NULL, FALSE ); // Main message loop: while(1) { while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if(msg.message == WM_QUIT) break; if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } if(msg.message == WM_QUIT) break; CallAppRender( false ); } AppExit(); return msg.wParam; }
DBG_INTERFACE bool ShouldUseNewAssertDialog() { static bool bMPIWorker = ( _tcsstr( Plat_GetCommandLine(), _T("-mpi_worker") ) != NULL ); if ( bMPIWorker ) { return false; } #ifdef DBGFLAG_ASSERTDLG return true; // always show an assert dialog #else return Plat_IsInDebugSession(); // only show an assert dialog if the process is being debugged #endif // DBGFLAG_ASSERTDLG }
static bool AreAssertsDisabled() { static bool bResult = ( _tcsstr( Plat_GetCommandLine(), _T("-noassert") ) != NULL ); return bResult; }
static bool IsDebugBreakEnabled() { static bool bResult = ( _tcsstr( Plat_GetCommandLine(), _T("-debugbreak") ) != NULL ); return bResult; }