-------------------------------------------------------------------------------------- Initialize the app --------------------------------------------------------------------------------------
| 1000 | // Initialize the app |
| 1001 | //-------------------------------------------------------------------------------------- |
| 1002 | void InitApp() |
| 1003 | { |
| 1004 | D3DCOLOR DlgColor = 0x88888888; // Semi-transparent background for the dialog |
| 1005 | |
| 1006 | g_SettingsDlg.Init(&g_DialogResourceManager); |
| 1007 | g_HUD.m_GUI.Init(&g_DialogResourceManager); |
| 1008 | g_HUD.m_GUI.SetBackgroundColors(DlgColor); |
| 1009 | g_HUD.m_GUI.SetCallback(OnGUIEvent, &g_Application); |
| 1010 | |
| 1011 | // This sample does not support MSAA, so disable it in the GUI |
| 1012 | g_SettingsDlg.GetDialogControl()->GetControl(DXUTSETTINGSDLG_D3D11_MULTISAMPLE_COUNT)->SetEnabled(false); |
| 1013 | g_SettingsDlg.GetDialogControl()->GetControl(DXUTSETTINGSDLG_D3D11_MULTISAMPLE_QUALITY)->SetEnabled(false); |
| 1014 | |
| 1015 | int iY = AMD::HUD::iElementDelta; |
| 1016 | |
| 1017 | g_HUD.m_GUI.AddButton(IDC_TOGGLEFULLSCREEN, L"Toggle full screen", AMD::HUD::iElementOffset, iY, |
| 1018 | AMD::HUD::iElementWidth, AMD::HUD::iElementHeight); |
| 1019 | g_HUD.m_GUI.AddButton(IDC_TOGGLEREF, L"Toggle REF (F3)", AMD::HUD::iElementOffset, |
| 1020 | iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, VK_F3); |
| 1021 | g_HUD.m_GUI.AddButton(IDC_CHANGEDEVICE, L"Change device (F2)", AMD::HUD::iElementOffset, |
| 1022 | iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, VK_F2); |
| 1023 | |
| 1024 | iY += AMD::HUD::iGroupDelta; |
| 1025 | |
| 1026 | // Add the magnify tool UI to our HUD |
| 1027 | g_MagnifyTool.InitApp(&g_HUD.m_GUI, iY); |
| 1028 | |
| 1029 | g_HUD.m_GUI.AddCheckBox(IDC_SET_RENDERING_MODE, L"Enable filter", AMD::HUD::iElementOffset, |
| 1030 | iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, |
| 1031 | g_Application.enableFiltering, 0U, false, &g_UI_enableFilterCheckBox); |
| 1032 | |
| 1033 | g_HUD.m_GUI.AddCheckBox(IDC_TOGGLE_PIPELINE_INTSTRUMENTATION, L"Instrument indirect rendering", |
| 1034 | AMD::HUD::iElementOffset, iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, |
| 1035 | AMD::HUD::iElementHeight, g_Application.instrumentIndirectRender, 0, false, |
| 1036 | &g_UI_pipelineInstrumentationCheckBox); |
| 1037 | |
| 1038 | g_HUD.m_GUI.AddCheckBox(IDC_TOGGLE_CULL_INDEX_FILTER, L"Index filter", AMD::HUD::iElementOffset, |
| 1039 | iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, |
| 1040 | TestFlag(g_Application.enabledFilters, AMD::GeometryFX_FilterDuplicateIndices), 0, false, |
| 1041 | &g_UI_cullIndexFilterCheckBox); |
| 1042 | |
| 1043 | g_HUD.m_GUI.AddCheckBox(IDC_TOGGLE_CULL_BACKFACE, L"Backface", AMD::HUD::iElementOffset, |
| 1044 | iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, |
| 1045 | TestFlag(g_Application.enabledFilters, AMD::GeometryFX_FilterBackface), 0, false, |
| 1046 | &g_UI_cullBackfaceCheckBox); |
| 1047 | |
| 1048 | g_HUD.m_GUI.AddCheckBox(IDC_TOGGLE_CULL_CLIP, L"Frustum cull", AMD::HUD::iElementOffset, |
| 1049 | iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, |
| 1050 | TestFlag(g_Application.enabledFilters, AMD::GeometryFX_FilterFrustum), 0, false, |
| 1051 | &g_UI_cullClipCheckBox); |
| 1052 | |
| 1053 | g_HUD.m_GUI.AddCheckBox(IDC_TOGGLE_CULL_SMALL_PRIMITIVES, L"Small primitives", |
| 1054 | AMD::HUD::iElementOffset, iY += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, |
| 1055 | AMD::HUD::iElementHeight, |
| 1056 | TestFlag(g_Application.enabledFilters, AMD::GeometryFX_FilterSmallPrimitives), 0, false, |
| 1057 | &g_UI_cullSmallPrimitivesCheckBox); |
| 1058 | |
| 1059 | g_HUD.m_GUI.AddCheckBox (IDC_TOGGLE_CULL_CLUSTER_BACKFACE, L"Backface cluster cull", |
no test coverage detected