本文整理汇总了C++中CGameSettings::GetNumVideoModes方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameSettings::GetNumVideoModes方法的具体用法?C++ CGameSettings::GetNumVideoModes怎么用?C++ CGameSettings::GetNumVideoModes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameSettings
的用法示例。
在下文中一共展示了CGameSettings::GetNumVideoModes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例2: SetVideoMode
///////////////////////////////////////////////////////////////
//
// CVideoModeManager::SetVideoMode
//
// Returns true if restart is required
//
///////////////////////////////////////////////////////////////
bool CVideoModeManager::SetVideoMode ( int iNextVideoMode, bool bNextWindowed, bool bNextFullScreenMinimize, int iNextFullscreenStyle )
{
bool bRequiresRestart = false;
// Resolution
if ( iNextVideoMode > 0 && iNextVideoMode < (int)m_pGameSettings->GetNumVideoModes () )
{
if ( m_iNextVideoMode != iNextVideoMode )
{
m_iNextVideoMode = iNextVideoMode;
if ( m_iCurrentVideoMode != iNextVideoMode )
{
bRequiresRestart = true;
}
}
}
// Windowed
if ( m_bNextWindowed != bNextWindowed )
{
m_bNextWindowed = bNextWindowed;
if ( m_bCurrentWindowed != bNextWindowed )
{
bRequiresRestart = true;
}
}
// Full Screen Minimize
m_bCurrentFullScreenMinimize = bNextFullScreenMinimize;
// Fullscreen style
if ( m_iNextFullscreenStyle != iNextFullscreenStyle )
{
m_iNextFullscreenStyle = iNextFullscreenStyle;
if ( m_iCurrentFullscreenStyle != m_iNextFullscreenStyle )
{
if ( m_iCurrentFullscreenStyle == FULLSCREEN_STANDARD || m_iNextFullscreenStyle == FULLSCREEN_STANDARD )
{
bRequiresRestart = true;
}
else
{
m_iCurrentFullscreenStyle = m_iNextFullscreenStyle;
}
}
}
SaveCVars ();
return bRequiresRestart;
}