这篇教程C++ CommandLine函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CommandLine函数的典型用法代码示例。如果您正苦于以下问题:C++ CommandLine函数的具体用法?C++ CommandLine怎么用?C++ CommandLine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CommandLine函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetFactory//-----------------------------------------------------------------------------// Init, shutdown//-----------------------------------------------------------------------------bool CHLModelViewerApp::PreInit( ){ CreateInterfaceFn factory = GetFactory(); ConnectTier1Libraries( &factory, 1 ); ConVar_Register( 0 ); MathLib_Init( 2.2f, 2.2f, 0.0f, 2.0f, false, false, false, false ); // Add paths... if ( !SetupSearchPaths( NULL, false, true ) ) return false; // Get the adapter from the command line.... const char *pAdapterString; int nAdapter = 0; if (CommandLine()->CheckParm( "-adapter", &pAdapterString )) { nAdapter = atoi( pAdapterString ); } int nAdapterFlags = 0; if ( CommandLine()->CheckParm( "-ref" ) ) { nAdapterFlags |= MATERIAL_INIT_REFERENCE_RASTERIZER; } g_pMaterialSystem->SetAdapter( nAdapter, nAdapterFlags ); if ( !g_pFileSystem->IsSteam() || CommandLine()->FindParm( "-OldDialogs" ) ) g_bOldFileDialogs = true; LoadFileSystemDialogModule(); return true; }
开发者ID:newroob,项目名称:bg2-2007,代码行数:38,
示例2: GetDefaultDepthFeatheringValueint GetDefaultDepthFeatheringValue( void ) //Allow the command-line to go against the default soft-particle value{ static int iRetVal = -1; if ( iRetVal == -1 ) { #if ( DEFAULT_PARTICLE_FEATHERING_ENABLED == 1 ) { if ( CommandLine()->CheckParm( "-softparticlesdefaultoff" ) ) iRetVal = 0; else iRetVal = 1; } #else { if ( CommandLine()->CheckParm( "-softparticlesdefaulton" ) ) iRetVal = 1; else iRetVal = 0; } #endif } return iRetVal;}
开发者ID:SCell555,项目名称:hl2-asw-port,代码行数:25,
示例3: atoi//-----------------------------------------------------------------------------// Init, shutdown//-----------------------------------------------------------------------------bool CVMTEditApp::PreInit( IAppSystemGroup *pAppSystemGroup ){ // initialize interfaces CreateInterfaceFn appFactory = pAppSystemGroup->GetFactory(); if (!vgui::VGui_InitInterfacesList( "VMTEDIT", &appFactory, 1 )) return false; g_pMatSystemSurface = (IMatSystemSurface *)pAppSystemGroup->FindSystem(MAT_SYSTEM_SURFACE_INTERFACE_VERSION); char *pArg; int iWidth = 1024; int iHeight = 768; bool bWindowed = (CommandLine()->CheckParm( "-fullscreen" ) == NULL); if (CommandLine()->CheckParm( "-width", &pArg )) { iWidth = atoi( pArg ); } if (CommandLine()->CheckParm( "-height", &pArg )) { iHeight = atoi( pArg ); } if (!CreateAppWindow( "VMTEdit", bWindowed, iWidth, iHeight )) return false; g_pMatSystemSurface->AttachToWindow( m_HWnd ); // NOTE: If we specifically wanted to use a particular shader DLL, we set it here... //g_pMaterialSystem->SetShader( "shaderapidx8" ); return true; }
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:35,
示例4: FileSystem_GetFileSystemDLLName//-----------------------------------------------------------------------------// Returns the name of the file system DLL to use//-----------------------------------------------------------------------------FSReturnCode_t FileSystem_GetFileSystemDLLName( char *pFileSystemDLL, int nMaxLen, bool &bSteam ){ bSteam = false; // Inside of here, we don't have a filesystem yet, so we have to assume that the filesystem_stdio or filesystem_steam // is in this same directory with us. char executablePath[MAX_PATH]; if ( !FileSystem_GetExecutableDir( executablePath, sizeof( executablePath ) ) ) return SetupFileSystemError( false, FS_INVALID_PARAMETERS, "FileSystem_GetExecutableDir failed." ); #if defined( _WIN32 ) Q_snprintf( pFileSystemDLL, nMaxLen, "%s%cfilesystem_stdio.dll", executablePath, CORRECT_PATH_SEPARATOR );#elif defined( POSIX ) Q_snprintf( pFileSystemDLL, nMaxLen, "%s%cfilesystem_stdio", executablePath, CORRECT_PATH_SEPARATOR ); struct stat statBuf; if ( CommandLine()->FindParm( "-steam" ) || CommandLine()->FindParm( "-steamlocal" ) || stat( pFileSystemDLL, &statBuf ) != 0 ) { Q_snprintf( pFileSystemDLL, nMaxLen, "%s%cfilesystem_steam.dylib", executablePath, CORRECT_PATH_SEPARATOR ); bSteam = true; }#else #error "define a filesystem dll name"#endif return FS_OK;}
开发者ID:AeroHand,项目名称:dota2-lua-engine,代码行数:30,
示例5: FileSystem_GetFileSystemDLLName//-----------------------------------------------------------------------------// Returns the name of the file system DLL to use//-----------------------------------------------------------------------------FSReturnCode_t FileSystem_GetFileSystemDLLName( char *pFileSystemDLL, int nMaxLen, bool &bSteam ){ bSteam = false; // Inside of here, we don't have a filesystem yet, so we have to assume that the filesystem_stdio or filesystem_steam // is in this same directory with us. char executablePath[MAX_PATH]; if ( !FileSystem_GetExecutableDir( executablePath, sizeof( executablePath ) ) ) return SetupFileSystemError( false, FS_INVALID_PARAMETERS, "FileSystem_GetExecutableDir failed." ); #if defined( _WIN32 ) && !defined( _X360 ) // If filesystem_stdio.dll is missing or -steam is specified, then load filesystem_steam.dll. // There are two command line parameters for Steam: // 1) -steam (runs Steam in remote filesystem mode; requires Steam backend) // 2) -steamlocal (runs Steam in local filesystem mode (all content off HDD) Q_snprintf( pFileSystemDLL, nMaxLen, "%s%cfilesystem_stdio.dll", executablePath, CORRECT_PATH_SEPARATOR ); if ( CommandLine()->FindParm( "-steam" ) || CommandLine()->FindParm( "-steamlocal" ) || _access( pFileSystemDLL, 0 ) != 0 ) { Q_snprintf( pFileSystemDLL, nMaxLen, "%s%cfilesystem_steam.dll", executablePath, CORRECT_PATH_SEPARATOR ); bSteam = true; }#elif defined( _X360 ) Q_snprintf( pFileSystemDLL, nMaxLen, "%s%cfilesystem_stdio.dll", executablePath, CORRECT_PATH_SEPARATOR );#elif defined( _LINUX ) Q_snprintf( pFileSystemDLL, nMaxLen, "%s%cfilesystem_i486.so", executablePath, CORRECT_PATH_SEPARATOR );#else #error "define a filesystem dll name"#endif return FS_OK;}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:34,
示例6: atoi//-----------------------------------------------------------------------------// PreInit, PostShutdown//-----------------------------------------------------------------------------bool CInputTestApp::PreInit( ){ if ( !BaseClass::PreInit() ) return false; if (!g_pFullFileSystem || !g_pInputSystem ) return false; // Add paths... if ( !SetupSearchPaths() ) return false; const char *pArg; int iWidth = 1024; int iHeight = 768; bool bWindowed = (CommandLine()->CheckParm( "-fullscreen" ) == NULL); if (CommandLine()->CheckParm( "-width", &pArg )) { iWidth = atoi( pArg ); } if (CommandLine()->CheckParm( "-height", &pArg )) { iHeight = atoi( pArg ); } if (!CreateAppWindow( "InputTest", bWindowed, iWidth, iHeight )) return false; g_pInputSystem->AttachToWindow( m_HWnd ); return true;}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:34,
示例7: Warning//---------------------------------------------------------------------------------// Purpose: called when the plugin is loaded, load the interface we need from the engine//---------------------------------------------------------------------------------bool CEmptyServerPlugin::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory ){ //ConnectTier1Libraries( &interfaceFactory, 1 ); pEngine = (IVEngineServer*)interfaceFactory(INTERFACEVERSION_VENGINESERVER, NULL); if (!pEngine){ Warning( "Unable to load IVEngineServer, aborting load/n" ); return false; } // assuming that the value of host_timer_spin_ms is 0 by any server configs if ( CommandLine()->CheckParm( "+host_timer_spin_ms" ) ) { m_bCommandPresent = 1; m_iDefaultValue = CommandLine()->ParmValue( "+host_timer_spin_ms", 0 ); if ( m_iDefaultValue < 0 ) m_iDefaultValue = 0; else if ( m_iDefaultValue > 15 ) m_iDefaultValue = 15; // god knows who would do this (idiots) CommandLine()->RemoveParm( "+host_timer_spin_ms" ); } //pEngine->ServerCommand( "con_logfile autotimer.log/n" ); //ConVar_Register( 0 ); return true;}
开发者ID:SizzlingStats,项目名称:sizzlingplugins,代码行数:31,
示例8: main//-----------------------------------------------------------------------------// Purpose: // Input : argc - // argv[] - // Output : int//-----------------------------------------------------------------------------int main( int argc, char* argv[] ){ SpewOutputFunc( SpewFunc ); Msg( "Valve Software - vcprojtomake.exe (%s)/n", __DATE__ ); Msg( "Modified for VS2010 Support by Killer Monkey/n" ); Msg( "<[email C++ CommandLineRPC函数代码示例 C++ CommandCost函数代码示例
|