本文整理汇总了C++中CDXUTDirectionWidget::SetButtonMask方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXUTDirectionWidget::SetButtonMask方法的具体用法?C++ CDXUTDirectionWidget::SetButtonMask怎么用?C++ CDXUTDirectionWidget::SetButtonMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXUTDirectionWidget
的用法示例。
在下文中一共展示了CDXUTDirectionWidget::SetButtonMask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
//g_LightControl.SetLightDirection( D3DXVECTOR3(-0.29f, 0.557f, 0.778f) );
g_LightControl.SetLightDirection( D3DXVECTOR3( -0.789f, 0.527f, 0.316f ) );
g_LightControl.SetButtonMask( MOUSE_MIDDLE_BUTTON );
// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent ); int iX = 15; int iY = 10;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", iX, iY, 125, 22 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", iX, iY += 24, 125, 22 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", iX, iY += 24, 125, 22, VK_F2 );
g_SampleUI.SetCallback( OnGUIEvent ); iX = 15; iY = 10;
// Title font for static
g_SampleUI.SetFont( 1, L"Arial", 14, FW_NORMAL );
CDXUTElement* pElement = g_SampleUI.GetDefaultElement( DXUT_CONTROL_STATIC, 0 );
if( pElement )
{
pElement->iFont = 1;
pElement->dwTextFormat = DT_RIGHT | DT_VCENTER;
}
// Technique
g_SampleUI.AddStatic( -1, L"Technique", iX, iY += 24, 115, 22 );
g_SampleUI.AddComboBox( IDC_TECHNIQUE, iX + 125, iY, 150, 22 );
g_SampleUI.GetComboBox( IDC_TECHNIQUE )->SetScrollBarWidth( 0 );
g_SampleUI.GetComboBox( IDC_TECHNIQUE )->AddItem( L"Local-deformable PRT", ( void* )"LDPRT" );
g_SampleUI.GetComboBox( IDC_TECHNIQUE )->AddItem( L"N dot L lighting", ( void* )"NdotL" );
// Animation speed
iY += 10;
g_SampleUI.AddStatic( -1, L"Animation Speed", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_ANIMATION_SPEED, iX + 125, iY, 125, 22, 0, 3000, 700 );
// Light intensity
iY += 10;
g_SampleUI.AddStatic( -1, L"Light Intensity", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_LIGHT_SLIDER, iX + 125, iY, 125, 22, 0, 1000, 500 );
g_SampleUI.AddStatic( IDC_ENV_LABEL, L"Env Intensity", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_ENV_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 600 );
// Color transmission
iY += 10;
g_SampleUI.AddStatic( IDC_RED_TRANSMIT_LABEL, L"Transmit Red", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_RED_TRANSMIT_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 1200 );
g_SampleUI.AddStatic( IDC_GREEN_TRANSMIT_LABEL, L"Transmit Green", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_GREEN_TRANSMIT_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 800 );
g_SampleUI.AddStatic( IDC_BLUE_TRANSMIT_LABEL, L"Transmit Blue", iX, iY += 24, 115, 22 );
g_SampleUI.AddSlider( IDC_BLUE_TRANSMIT_SLIDER, iX + 125, iY, 125, 22, 0, 3000, 350 );
}