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


C++ CDXUTComboBox::GetSelectedIndex方法代码示例

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


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

示例1: OnGUIEvent

//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
void CALLBACK OnGUIEvent(UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext)
{
    switch (nControlID)
    {
        case IDC_TOGGLEFULLSCREEN:   DXUTToggleFullScreen(); break;
        case IDC_TOGGLEREF:          DXUTToggleREF();        break;
           
        case IDC_CHANGEDEVICE:
        {
            g_SettingsDlg.SetActive(!g_SettingsDlg.IsActive()); 
            break;
        }
        case IDC_CHANGESCENE:
        {
            CDXUTComboBox* pComboBox = (CDXUTComboBox*) pControl;
            g_CurrentSceneId = pComboBox->GetSelectedIndex();
            break;
        }
        case IDC_BLUR_AO:
        {
            g_BlurAO = g_HUD.GetCheckBox(nControlID)->GetChecked();
            break;
        }
        case IDC_DEINTERLEAVE:
        {
            g_UseDeinterleavedTexturing = g_HUD.GetCheckBox(nControlID)->GetChecked();
            break;
        }
        case IDC_RANDOMIZE:
        {
            g_RandomizeSamples = g_HUD.GetCheckBox(nControlID)->GetChecked();
            break;
        }
        case IDC_RADIUS_SLIDER:
        {
            g_AOParams.Radius = (float) g_HUD.GetSlider(IDC_RADIUS_SLIDER)->GetValue() * MAX_RADIUS_MULT / 100.0f;

            WCHAR sz[100];
            StringCchPrintf(sz, 100, UI_RADIUS_MULT L"%0.2f", g_AOParams.Radius); 
            g_HUD.GetStatic(IDC_RADIUS_STATIC)->SetText(sz);

            break;
        }
        case IDC_BIAS_SLIDER:
        {
            g_AOParams.Bias = (float) g_HUD.GetSlider(IDC_BIAS_SLIDER)->GetValue() / 1000.f;

            WCHAR sz[100];
            StringCchPrintf(sz, 100, UI_AO_BIAS L"%g", g_AOParams.Bias); 
            g_HUD.GetStatic(IDC_BIAS_STATIC)->SetText(sz);

            break;
        }
        case IDC_EXPONENT_SLIDER: 
        {
            g_AOParams.PowerExponent = (float)g_HUD.GetSlider(IDC_EXPONENT_SLIDER)->GetValue() / 100.0f;

            WCHAR sz[100];
            StringCchPrintf(sz, 100, UI_POW_EXPONENT L"%0.2f", g_AOParams.PowerExponent);
            g_HUD.GetStatic(IDC_EXPONENT_STATIC)->SetText(sz);

            break;
        }
        case IDC_BLUR_SHARPNESS_SLIDER: 
        {
            g_AOParams.Blur.Sharpness = (float)g_HUD.GetSlider(IDC_BLUR_SHARPNESS_SLIDER)->GetValue() / 100.0f;

            WCHAR sz[100];
            StringCchPrintf(sz, 100, UI_BLUR_SHARPNESS L"%0.2f", g_AOParams.Blur.Sharpness);
            g_HUD.GetStatic(IDC_BLUR_SHARPNESS_STATIC)->SetText(sz);

            break;
        }
        case IDC_PER_PIXEL_AO:
        {
            g_AOParams.Output.MSAAMode = GFSDK_SSAO_PER_PIXEL_AO;
            break;
        }
        case IDC_PER_SAMPLE_AO:
        {
            g_AOParams.Output.MSAAMode = GFSDK_SSAO_PER_SAMPLE_AO;
            break;
        }
        case IDC_1xMSAA:
        case IDC_2xMSAA:
        case IDC_4xMSAA:
        case IDC_8xMSAA:
        {
            g_RenderTargetsDirty = true;
            g_MSAACurrentSettings = nControlID - IDC_1xMSAA;
            assert(g_MSAACurrentSettings >= MSAA_MODE_1X);
            assert(g_MSAACurrentSettings <= MSAA_MODE_8X);
            break;
        }
    }
}
开发者ID:151706061,项目名称:D3DSamples,代码行数:99,代码来源:DeinterleavedTexturing.cpp


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