Graphics Reference
In-Depth Information
//—————————————————————————————————————————————————————————————————————————
//Initialize the app
//—————————————————————————————————————————————————————————————————————————
void InitApp()
{
g_pFont = NULL;
g_pEffect = NULL;
g_bShowHelp = true;
g_bShowText = true;
g_pMesh = NULL;
g_pTexRender = NULL;
g_bBloom = TRUE;
g_eEncodingMode = RGBE8;
g_eRenderMode = DECODED;
g_pCurTechnique = &g_aTechHandles;
for(int i = 0; i < = 256; i++)
{
g_aPowsOfTwo[i] = powf(2.0f, (float)(i - 128));
}
ZeroMemory(g_apTexToneMap, sizeof(g_apTexToneMap));
ZeroMemory(g_apTexBloom, sizeof(g_apTexBloom));
//ZeroMemory(g_aTechHandles, sizeof(g_aTechHandles));
//Initialize dialogs
g_SettingsDlg.Init(&g_DialogResourceManager);
g_HUD.Init(&g_DialogResourceManager);
g_SampleUI.Init(&g_DialogResourceManager);
g_HUD.SetCallback(OnGUIEvent); int iY = 10;
g_HUD.AddButton(IDC_TOGGLEFULLSCREEN, L”Toggle full screen”, 35, iY,
125, 22);
g_HUD.AddButton(IDC_TOGGLEREF, L”Toggle REF (F3)”, 35, iY + = 24,
125, 22);
g_HUD.AddButton(IDC_CHANGEDEVICE, L”Change device (F2)”, 35, iY + =
24, 125, 22, VK_F2);
g_SampleUI.SetCallback(OnGUIEvent); iY = 10;
g_SampleUI.AddComboBox(IDC_FILLMODE, 10, iY, 150, 24, L'F');
g_SampleUI.GetComboBox(IDC_FILLMODE)->AddItem(L”(F)illmode: Solid”,
(void*)0);
g_SampleUI.GetComboBox(IDC_FILLMODE)->AddItem(L”(F)illmode:
Wireframe”, (void*)1);
g_SampleUI.AddStatic(IDC_SEGMENTLABEL, L”Number of segments: 1”, 10,
iY + = 30, 150, 16);
g_SampleUI.AddSlider(IDC_SEGMENT, 10, iY + = 14, 150, 24, 1, 10, 1);
g_SampleUI.AddCheckBox(IDC_HWNPATCHES, L”Use hardware N-patches”,
10, iY + = 26, 150, 20, true, L'H');
g_SampleUI.AddStatic(IDC_CUBETEXTURELABEL, L”Skymap Texture:”,
10, iY + = 26, 150, 16);
g_SampleUI.AddComboBox(IDC_CUBETEXTURE, 10, iY + = 14, 150, 24);
Search WWH ::




Custom Search