本文整理汇总了C++中CGameSettings::GetVideoModeInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameSettings::GetVideoModeInfo方法的具体用法?C++ CGameSettings::GetVideoModeInfo怎么用?C++ CGameSettings::GetVideoModeInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameSettings
的用法示例。
在下文中一共展示了CGameSettings::GetVideoModeInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Vid
void CCommandFuncs::Vid(const char* szParameters)
{
#if 0
// ripped from the renderware sdk
CGameSettings * gameSettings = CCore::GetSingleton ( ).GetGame ( )->GetSettings();
if ( strlen(szParameters) == 0 )
{
VideoMode vidModemInfo;
int vidMode, numVidModes, currentVidMode;
numVidModes = gameSettings->GetNumVideoModes();
currentVidMode = gameSettings->GetCurrentVideoMode();
// Add the available video modes to the dialog
for (vidMode = 0; vidMode < numVidModes; vidMode++)
{
gameSettings->GetVideoModeInfo(&vidModemInfo, vidMode);
SString strMode ( "%d: %lu x %lu x %lu %s %s",
vidMode, vidModemInfo.width, vidModemInfo.height,
vidModemInfo.depth,
vidModemInfo.flags & rwVIDEOMODEEXCLUSIVE ?
"(Fullscreen)" : "",
currentVidMode == vidMode ? "(Current)" : "" );
CCore::GetSingleton ().GetConsole ()->Printf ( strMode );
}
CCore::GetSingleton ().GetConsole ()->Printf( "* Syntax: vid <mode>" );
}
else
{
// Make sure no mod is loaded
if ( !CCore::GetSingleton ().GetModManager ()->IsLoaded () )
{
// Grab the device window and what mode to switch to
int iParameter = atoi ( szParameters );
// Change the video mode
GetVideoModeManager ()->ChangeVideoMode ( iParameter );
// Grab viewport settings
int iViewportX = CCore::GetSingleton ().GetGraphics()->GetViewportWidth ();
int iViewportY = CCore::GetSingleton ().GetGraphics()->GetViewportHeight ();
// Re-create all CGUI windows, for correct absolute sizes that depend on the (new) screen resolution
CCore::GetSingleton ().GetLocalGUI ()->DestroyWindows ();
CCore::GetSingleton ().GetGUI ()->SetResolution ( (float) iViewportX, (float) iViewportY );
CCore::GetSingleton ().GetLocalGUI ()->CreateWindows ();
// Reload console, serverbrowser and chat settings (removed in DestroyWindows)
g_pCore->ApplyConsoleSettings ();
g_pCore->ApplyMenuSettings ();
}
else
{
g_pCore->GetConsole ()->Echo ( "vid: Please disconnect before changing video mode" );
}
}
#endif
}