当前位置: 首页>>代码示例>>C++>>正文


C++ CGameSettings::GetCurrentVideoMode方法代码示例

本文整理汇总了C++中CGameSettings::GetCurrentVideoMode方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameSettings::GetCurrentVideoMode方法的具体用法?C++ CGameSettings::GetCurrentVideoMode怎么用?C++ CGameSettings::GetCurrentVideoMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGameSettings的用法示例。


在下文中一共展示了CGameSettings::GetCurrentVideoMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Window

void CCommandFuncs::Window ( const char* szParameters )
{
#if 0
    // Make sure no mod is loaded
    if ( !CCore::GetSingleton ().GetModManager ()->IsLoaded () )
    {
        CGameSettings * gameSettings = CCore::GetSingleton ( ).GetGame ( )->GetSettings();
        unsigned int currentMode = gameSettings->GetCurrentVideoMode();

        if ( currentMode == 0 )
        {
            GetVideoModeManager ()->ChangeVideoMode ( VIDEO_MODE_FULLSCREEN );
            g_pCore->GetLocalGUI()->GetMainMenu ()->RefreshPositions();
        }
        else
        {
            // Run "vid 0"
            Vid ( "0" );
        }
    }
    else
    {
        g_pCore->GetConsole ()->Echo ( "window: Please disconnect first" );
    }
#endif
}
开发者ID:Anubhav652,项目名称:mtasa-blue,代码行数:26,代码来源:CCommandFuncs.cpp

示例2: 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
}
开发者ID:Necktrox,项目名称:mtasa-blue,代码行数:60,代码来源:CCommandFuncs.cpp

示例3: LoadCVars

///////////////////////////////////////////////////////////////
//
// CVideoModeManager::LoadCVars
//
// Loads to current
//
///////////////////////////////////////////////////////////////
void CVideoModeManager::LoadCVars ( void )
{
    // Upgrade display_alttab_handler
    bool bAltTabHandlerWasEnabled = CVARS_GET_VALUE < bool > ( "display_alttab_handler" );
    int iFullscreenStyle = CVARS_GET_VALUE < int > ( "display_fullscreen_style" );
    if ( bAltTabHandlerWasEnabled && iFullscreenStyle == 0 )
    {
        CVARS_SET ( "display_alttab_handler", false );
        CVARS_SET ( "display_fullscreen_style", FULLSCREEN_BORDERLESS );
    }

    // Apply override
    if ( GetApplicationSettingInt( "nvhacks", "optimus-force-windowed" ) )
    {
        SetApplicationSettingInt( "nvhacks", "optimus-force-windowed", 0 );
        CVARS_SET ( "display_windowed", true );
    }

    m_iCurrentVideoMode = m_pGameSettings->GetCurrentVideoMode ();
    CVARS_GET ( "display_windowed",             m_bCurrentWindowed );
    CVARS_GET ( "display_fullscreen_style",     m_iCurrentFullscreenStyle );
    CVARS_GET ( "multimon_fullscreen_minimize", m_bCurrentFullScreenMinimize );
}
开发者ID:ntauthority,项目名称:openvice,代码行数:30,代码来源:CVideoModeManager.cpp


注:本文中的CGameSettings::GetCurrentVideoMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。