Skip to content

Instantly share code, notes, and snippets.

@suplo
Created June 11, 2013 02:42
Show Gist options
  • Save suplo/5754160 to your computer and use it in GitHub Desktop.
Save suplo/5754160 to your computer and use it in GitHub Desktop.
Add button, text, etc to GUI at init
void InitApp()
{
// 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 );
// Add mixed vp to the available vp choices in device settings dialog.
DXUTGetD3D9Enumeration()->SetPossibleVertexProcessingList( true, false, false, true );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
g_SampleUI.AddComboBox( IDC_METHOD, 0, iY, 230, 24, L'S' );
g_SampleUI.GetComboBox( IDC_METHOD )->AddItem( L"Fixed function non-indexed (s)kinning", ( void* )D3DNONINDEXED );
g_SampleUI.GetComboBox( IDC_METHOD )->AddItem( L"Fixed function indexed (s)kinning", ( void* )D3DINDEXED );
g_SampleUI.GetComboBox( IDC_METHOD )->AddItem( L"Software (s)kinning", ( void* )SOFTWARE );
g_SampleUI.GetComboBox( IDC_METHOD )->AddItem( L"ASM shader indexed (s)kinning", ( void* )D3DINDEXEDVS );
g_SampleUI.GetComboBox( IDC_METHOD )->AddItem( L"HLSL shader indexed (s)kinning", ( void* )D3DINDEXEDHLSLVS );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment