本文整理汇总了C++中CDXUTDialog::AddButton方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXUTDialog::AddButton方法的具体用法?C++ CDXUTDialog::AddButton怎么用?C++ CDXUTDialog::AddButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXUTDialog
的用法示例。
在下文中一共展示了CDXUTDialog::AddButton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
g_bSpinning = true;
g_D3DSettingsDlg.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_CHANGEDEVICE, L"Change device (F2)", 35, iY += 24, 125, 22, VK_F2 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 35, iY += 24, 125, 22, VK_F3 );
g_HUD.AddButton( IDC_TOGGLEWARP, L"Toggle WARP (F4)", 35, iY += 24, 125, 22, VK_F4 );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
WCHAR sz[100];
iY += 24;
swprintf_s( sz, 100, L"Explode Amount: %0.2f", g_fExplode );
g_SampleUI.AddStatic( IDC_EXPLODE_STATIC, sz, 35, iY += 24, 125, 22 );
g_SampleUI.AddSlider( IDC_EXPLODE_SCALE, 50, iY += 24, 100, 22, 0, 3000, ( int )( g_fExplode * 100.0f ) );
iY += 24;
g_SampleUI.AddCheckBox( IDC_TOGGLESPIN, L"Toggle Spinning", 35, iY += 24, 125, 22, g_bSpinning );
}
示例2: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
// Initialize dialogs
g_D3DSettingsDlg.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent ); INT iY = 10;
// Add tons of GUI stuff
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 0, iY, 170, 23 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 0, iY += 26, 170, 23, VK_F2 );
g_HUD.AddButton( IDC_TOGGLEWARP, L"Toggle WARP (F4)", 0, iY += 26, 170, 23, VK_F4 );
g_HUD.AddCheckBox( IDC_TOGGLEDYNAMICLIGHTS, L"Dynamic Lights", 0, iY+=26, 170, 23, true, VK_F8 );
g_HUD.AddComboBox( IDC_DEBUGRENDERING, 0, iY +=26, 170, 23, VK_F9, false, &g_DebugRenderingCombo );
g_DebugRenderingCombo->AddItem( L"Scene", ULongToPtr( DEBUG_RENDERING_NONE ) );
g_DebugRenderingCombo->AddItem( L"Normals", ULongToPtr( DEBUG_RENDERING_NORMALS ) );
g_DebugRenderingCombo->AddItem( L"Colors", ULongToPtr( DEBUG_RENDERING_COLORS ) );
g_DebugRenderingCombo->AddItem( L"LLL", ULongToPtr( DEBUG_RENDERING_LLL ) );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
}
示例3: InitApp
void InitApp() {
dprintf("rawr\n");
srand(UINT(time(NULL)));
g_pGameRoot = new CGameRoot();
g_pGameRoot->AssignWorldFile(LEVEL_TO_LOAD);
g_pGameRoot->AssignModelSetFile(MODEL_SET_TO_LOAD);
g_pGameRoot->AssignCharacterSetFile(CHAR_SET_TO_LOAD);
g_pGameRoot->AssignSpriteAnimationSetFile(SPRITE_SET_TO_LOAD);
g_pGameRoot->LoadMasterServersFile(MASTER_SERVERS_TO_LOAD);
// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_UI.Init( &g_DialogResourceManager );
// Set up HUD
g_HUD.SetCallback( OnGUIEvent ); int iY = 0;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 0, iY, 125, 22 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 0, iY += 24, 125, 22, VK_F2 );
// Set up UI
g_UI.SetCallback( OnGUIEvent ); iY = 0;
CDXUTEditBox *pEditBox;
g_UI.AddEditBox( IDC_FILEHEIGHTMAP, L"rawr", 5, iY, 210, 20, false, &pEditBox );
if( pEditBox )
{
pEditBox->SetBorderWidth( 1 );
pEditBox->SetSpacing( 2 );
}
g_UI.AddButton( IDC_LOADHEIGHTMAP, L"Load HeightMap", 0, iY += 24, 100, 22 );
}
示例4: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
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_CHANGEDEVICE, L"Change device (F2)", 35, iY += 24, 125, 22, VK_F2 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 35, iY += 24, 125, 22, VK_F3 );
g_HUD.AddButton( IDC_TOGGLEWARP, L"Toggle WARP (F4)", 35, iY += 24, 125, 22, VK_F4 );
g_SampleUI.SetCallback( OnGUIEvent );
// Title font for comboboxes
g_SampleUI.SetFont( 1, L"Arial", 14, FW_BOLD );
CDXUTElement* pElement = g_SampleUI.GetDefaultElement( DXUT_CONTROL_STATIC, 0 );
if( pElement )
{
pElement->iFont = 1;
pElement->dwTextFormat = DT_LEFT | DT_BOTTOM;
}
int checkboxY = 0;
g_SampleUI.AddStatic( IDC_STATIC, L"(S)ubset", 20, checkboxY+=0, 105, 25 );
g_SampleUI.AddComboBox( IDC_SUBSET, 20, checkboxY+=25, 140, 24, 'S' );
g_SampleUI.AddStatic( IDC_STATIC, L"Scene (R)asterizer Mode", 20, checkboxY+=25, 105, 25 );
g_SampleUI.AddComboBox( IDC_SCENERASTERIZER_MODE, 20, checkboxY+=25, 140, 24, 'S' );
g_SampleUI.AddStatic( IDC_STATIC, L"AABB Levels", 20, checkboxY+=25, 105, 25 );
g_SampleUI.AddComboBox( IDC_AABBSUBLEVEL, 20, checkboxY+=25, 140, 24, 'S' );
}
示例5: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
#ifdef CONSOLE
std::cout << "InitApp" << std::endl;
#endif
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, VK_F3 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 35, iY += 24, 125, 22, VK_F2 );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
g_Camera.SetRotateButtons( true, false, false );
//g_pCamera = new CGlobalCamera();
D3DVECTOR Vdir={0,-1,0};
memset(&g_light,0,sizeof(D3DLIGHT9));
g_light.Type = D3DLIGHT_DIRECTIONAL;
g_light.Diffuse.r = 1.0f;
g_light.Diffuse.g = 1.0f;
g_light.Diffuse.b = 1.0f;
g_light.Diffuse.a = 1.0f;
g_light.Direction = Vdir;
// Inits Particle Engine
}
示例6: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
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 );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
// Title font for comboboxes
g_SampleUI.SetFont( 1, L"Arial", 14, FW_BOLD );
CDXUTElement* pElement = g_SampleUI.GetDefaultElement( DXUT_CONTROL_STATIC, 0 );
if( pElement )
{
pElement->iFont = 1;
pElement->dwTextFormat = DT_LEFT | DT_BOTTOM;
}
g_SampleUI.AddStatic( IDC_STATIC, L"(S)ubset", 20, 0, 105, 25 );
g_SampleUI.AddComboBox( IDC_SUBSET, 20, 25, 140, 24, 'S' );
g_SampleUI.AddButton( IDC_SAVETOX, L"Save Mesh To X file", 20, 50, 140, 24, 'X' );
}
示例7: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
// Initialize dialogs
g_D3DSettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent ); int iY = 20;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 0, iY, 170, 22 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 0, iY += 26, 170, 22, VK_F3 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 0, iY += 26, 170, 22, VK_F2 );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
WCHAR sz[100];
iY += 24;
swprintf_s( sz, L"Patch Divisions: %2.1f", g_fSubdivs );
g_SampleUI.AddStatic( IDC_PATCH_SUBDIVS_STATIC, sz, 10, iY += 26, 150, 22 );
g_SampleUI.AddSlider( IDC_PATCH_SUBDIVS, 10, iY += 24, 150, 22, 10 * MIN_DIVS, 10 * MAX_DIVS, (int)(g_fSubdivs * 10) );
iY += 24;
g_SampleUI.AddCheckBox( IDC_TOGGLE_LINES, L"Toggle Wires", 20, iY += 26, 150, 22, g_bDrawWires );
iY += 24;
g_SampleUI.AddRadioButton( IDC_PARTITION_INTEGER, IDC_PARTITION_MODE, L"Integer", 20, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_PARTITION_FRAC_EVEN, IDC_PARTITION_MODE, L"Fractional Even", 20, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_PARTITION_FRAC_ODD, IDC_PARTITION_MODE, L"Fractional Odd", 20, iY += 26, 170, 22 );
g_SampleUI.GetRadioButton( IDC_PARTITION_INTEGER )->SetChecked( true );
// Setup the camera's view parameters
static const XMVECTORF32 s_vecEye = { 1.0f, 1.5f, -3.5f, 0.f };
static const XMVECTORF32 s_vecAt = { 0.0f, 0.0f, 0.0f, 0.f };
g_Camera.SetViewParams( s_vecEye, s_vecAt );
}
示例8: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent );
int iY = 30;
int iYo = 26;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 0, iY, 170, 22 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 0, iY += iYo, 170, 22, VK_F2 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 0, iY += iYo, 170, 22, VK_F3 );
g_HUD.AddButton( IDC_TOGGLEWARP, L"Toggle WARP (F4)", 0, iY += iYo, 170, 22, VK_F4 );
g_SampleUI.SetCallback( OnGUIEvent );
CDXUTComboBox* pComboBox = nullptr;
g_SampleUI.AddStatic( IDC_STATIC, L"(G)roup", 10, 0, 170, 25 );
g_SampleUI.AddComboBox( IDC_GROUP, 0, 25, 170, 24, 'G', false, &pComboBox );
if( pComboBox )
pComboBox->SetDropHeight( 50 );
pComboBox->AddItem( L"Frustum", IntToPtr( 0 ) );
pComboBox->AddItem( L"Axis-aligned Box", IntToPtr( 1 ) );
pComboBox->AddItem( L"Oriented Box", IntToPtr( 2 ) );
pComboBox->AddItem( L"Ray", IntToPtr( 3 ) );
InitializeObjects();
}
示例9: InitGUI
//--------------------------------------------------------------------------------------
//
//--------------------------------------------------------------------------------------
void InitGUI()
{
// Initialize dialogs
g_SettingsDlg.Init(&g_DialogResourceManager);
g_HUD.Init(&g_DialogResourceManager);
g_HUD.SetCallback(OnGUIEvent);
g_TextRenderer.Init(&g_DialogResourceManager);
int iY = 10;
g_HUD.AddButton (IDC_TOGGLEFULLSCREEN, L"Toggle full screen" , 35, iY, 160, 22);
g_HUD.AddButton (IDC_TOGGLEREF, L"Toggle REF (F3)" , 35, iY += 24, 160, 22, VK_F3);
g_HUD.AddButton (IDC_CHANGEDEVICE, L"Change device (F2)" , 35, iY += 24, 160, 22, VK_F2);
iY += 20;
g_HUD.AddCheckBox(IDC_DEINTERLEAVE, L"Deinterleaved Texturing", 35, iY += 28, 125, 22, g_UseDeinterleavedTexturing);
g_HUD.AddCheckBox(IDC_RANDOMIZE, L"Randomize Samples", 35, iY += 28, 125, 22, g_RandomizeSamples);
g_HUD.AddCheckBox(IDC_BLUR_AO, L"Blur AO", 35, iY += 28, 125, 22, g_BlurAO);
iY += 24;
CDXUTComboBox *pComboBox;
g_HUD.AddComboBox(IDC_CHANGESCENE, 35, iY += 24, 160, 22, 'M', false, &pComboBox);
for (int i = 0; i < ARRAYSIZE(g_MeshDesc); i++)
{
pComboBox->AddItem(g_MeshDesc[i].Name, NULL);
}
iY += 24;
WCHAR sz[100];
int dy = 20;
StringCchPrintf(sz, 100, UI_RADIUS_MULT L"%0.2f", g_AOParams.Radius);
g_HUD.AddStatic(IDC_RADIUS_STATIC, sz, 35, iY += dy, 125, 22);
g_HUD.AddSlider(IDC_RADIUS_SLIDER, 50, iY += dy, 100, 22, 0, 100, int(g_AOParams.Radius / MAX_RADIUS_MULT * 100));
StringCchPrintf(sz, 100, UI_AO_BIAS L"%g", g_AOParams.Bias);
g_HUD.AddStatic(IDC_BIAS_STATIC, sz, 35, iY += dy, 125, 22);
g_HUD.AddSlider(IDC_BIAS_SLIDER, 50, iY += dy, 100, 22, 0, 500, int(g_AOParams.Bias * 1000));
StringCchPrintf(sz, 100, UI_POW_EXPONENT L"%0.2f", g_AOParams.PowerExponent);
g_HUD.AddStatic(IDC_EXPONENT_STATIC, sz, 35, iY += dy, 125, 22);
g_HUD.AddSlider(IDC_EXPONENT_SLIDER, 50, iY += dy, 100, 22, 0, 400, (int)(100.0f*g_AOParams.PowerExponent));
StringCchPrintf(sz, 100, UI_BLUR_SHARPNESS L"%0.2f", g_AOParams.Blur.Sharpness);
g_HUD.AddStatic(IDC_BLUR_SHARPNESS_STATIC, sz, 35, iY += dy, 125, 22);
g_HUD.AddSlider(IDC_BLUR_SHARPNESS_SLIDER, 50, iY += dy, 100, 22, 0, 1600, (int)(100.0f*g_AOParams.Blur.Sharpness));
UINT ButtonGroup = 0;
iY += 24;
g_HUD.AddRadioButton( IDC_1xMSAA, ButtonGroup, L"1X MSAA", 35, iY += 24, 125, 22, (g_MSAACurrentSettings == MSAA_MODE_1X) );
g_HUD.AddRadioButton( IDC_2xMSAA, ButtonGroup, L"2X MSAA", 35, iY += 24, 125, 22, (g_MSAACurrentSettings == MSAA_MODE_2X) );
g_HUD.AddRadioButton( IDC_4xMSAA, ButtonGroup, L"4X MSAA", 35, iY += 24, 125, 22, (g_MSAACurrentSettings == MSAA_MODE_4X) );
g_HUD.AddRadioButton( IDC_8xMSAA, ButtonGroup, L"8X MSAA", 35, iY += 24, 125, 22, (g_MSAACurrentSettings == MSAA_MODE_8X) );
++ButtonGroup;
iY += 24;
g_HUD.AddRadioButton( IDC_PER_PIXEL_AO, ButtonGroup, L"PER_PIXEL_AO", 35, iY += 24, 125, 22, (g_AOParams.Output.MSAAMode == GFSDK_SSAO_PER_PIXEL_AO) );
g_HUD.AddRadioButton( IDC_PER_SAMPLE_AO, ButtonGroup, L"PER_SAMPLE_AO", 35, iY += 24, 125, 22, (g_AOParams.Output.MSAAMode == GFSDK_SSAO_PER_SAMPLE_AO) );
}
示例10: 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 );
}
示例11: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
// Initialize dialogs
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.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 );
}
示例12: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
displacement_level = 1.5;
tess_lvl = 80;
drawwire = false;
D3DXVECTOR3 vLightDir( -1, 1, -1 );
D3DXVec3Normalize( &vLightDir, &vLightDir );
g_LightControl.SetLightDirection( vLightDir );
// Initialize dialogs
g_D3DSettingsDlg.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", 0, iY, 170, 23 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 0, iY += 26, 170, 23, VK_F3 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 0, iY += 26, 170, 23, VK_F2 );
g_SampleUI.SetCallback( OnGUIEvent );
iY = -30;
WCHAR sz[100];
//iY += 24;
swprintf_s( sz, L"Tessellation Level: %2.1f", tess_lvl );
g_SampleUI.AddStatic( IDC_TESSLVL_STATIC, sz, -10, iY += 26, 150, 22 );
g_SampleUI.AddSlider( IDC_TESSLVL, 10, iY += 24, 150, 22, 1, 80, tess_lvl );
iY += 14;
swprintf_s( sz, L"Displacement Level: %2.1f", displacement_level );
g_SampleUI.AddStatic( IDC_DISPLACEMENTLVL_STATIC, sz, -10, iY += 26, 150, 22 );
g_SampleUI.AddSlider( IDC_DISPLACEMENTLVL, 10, iY += 24, 150, 22, 0, 150, (float)(displacement_level)/ 100.0f );
iY += 10;
g_SampleUI.AddCheckBox( IDC_TOGGLEWIRE, L"Toggle Wires", 20, iY += 26, 150, 22, drawwire );
iY += 10;
g_SampleUI.AddCheckBox( IDC_TOGGLEDT, L"Toggle Distanced Based tesselation", -120, iY += 26, 150, 22, true );
iY += 10;
g_SampleUI.AddRadioButton( IDC_PARTITION_INTEGER, IDC_PARTITION_MODE, L"Integer", 20, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_PARTITION_FRAC_EVEN, IDC_PARTITION_MODE, L"Fractional Even", 20, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_PARTITION_FRAC_ODD, IDC_PARTITION_MODE, L"Fractional Odd", 20, iY += 26, 170, 22 );
g_SampleUI.GetRadioButton( IDC_PARTITION_INTEGER )->SetChecked( true );
iY += 10;
g_SampleUI.AddCheckBox( IDC_TOGGLEBUILDING, L"Toggle buildings", 20, iY += 26, 150, 22, true );
}
示例13: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
g_D3DSettingsDlg.Init(&g_DialogResourceManager);
g_HUD.Init(&g_DialogResourceManager);
g_SampleUI.Init(&g_DialogResourceManager);
g_HUD.SetCallback(OnGUIEvent); int iY = 20;
g_HUD.AddButton(IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 0, iY, 170, 23);
g_HUD.AddButton(IDC_TOGGLEREF, L"Toggle REF (F3)", 0, iY += 26, 170, 23, VK_F3);
g_HUD.AddButton(IDC_CHANGEDEVICE, L"Change device (F2)", 0, iY += 26, 170, 23, VK_F2);
g_SampleUI.SetCallback(OnGUIEvent);
}
示例14: REF
//--------------------------------------------------------------------------------------
// Create any D3D9 resources that will live through a device reset (D3DPOOL_MANAGED)
// and aren't tied to the back buffer size
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D9CreateDevice( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_DialogResourceManager.OnD3D9CreateDevice( pd3dDevice );
g_SettingsDlg.OnD3D9CreateDevice( pd3dDevice );
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, VK_F3 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 35, iY += 24, 125, 22, VK_F2 );
g_SampleUI.SetCallback( OnGUIEvent );
iY = 10;
g_SampleUI.AddCheckBox( IDC_DISABLEALBEDO, L"Disable albedo", 35, iY += 24, 160, 22, g_DisableAlbedo );
g_SampleUI.AddCheckBox( IDC_PAUSEANIMATION, L"Pause animation", 35, iY += 24, 160, 22, g_PauseAnimation );
g_SampleUI.AddCheckBox( IDC_DISABLESKINING, L"Disable skining", 35, iY += 24, 160, 22, g_DisableSkining );
g_SampleUI.AddCheckBox( IDC_SHOWNORMALS, L"Show normals", 35, iY += 24, 160, 22, g_ShowNormals );
CDXUTComboBox* pCombo;
g_SampleUI.AddComboBox( IDC_TECHNIQUECOMBO, 35, iY += 30, 160, 22, 0, false, &pCombo );
if( pCombo )
{
pCombo->SetDropHeight( 100 );
pCombo->AddItem( L"Unpacked TBN", ( LPVOID )0x0 );
pCombo->AddItem( L"Packed TBN", ( LPVOID )0x1 );
pCombo->AddItem( L"Unpacked Quaternion", ( LPVOID )0x2 );
pCombo->AddItem( L"Packed Quaternion", ( LPVOID )0x3 );
pCombo->SetSelectedByIndex(g_TechniqueIndex);
}
iY = 10;
D3DXCreateFont( pd3dDevice, 15, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial", &g_pFont9 );
d3dAnimation.Create(pd3dDevice);
d3dMesh.Create(pd3dDevice);
d3dFloor.Create(pd3dDevice);
FBXImporter importer;
const char* fbxFileName = ".\\data\\MilitaryMechanic.fbx";
importer.Import(fbxFileName, &d3dMesh, &d3dAnimation);
return S_OK;
}
示例15: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
g_SettingsDlg.Init( &g_DialogResourceManager );
g_HUD.Init( &g_DialogResourceManager );
g_SampleUI.Init( &g_DialogResourceManager );
g_HUD.SetCallback( OnGUIEvent );
int iY = 30;
int iYo = 26;
g_HUD.AddButton( IDC_TOGGLEFULLSCREEN, L"Toggle full screen", 0, iY, 170, 22 );
g_HUD.AddButton( IDC_CHANGEDEVICE, L"Change device (F2)", 0, iY += iYo, 170, 22, VK_F2 );
g_HUD.AddButton( IDC_TOGGLEREF, L"Toggle REF (F3)", 0, iY += iYo, 170, 22, VK_F3 );
g_HUD.AddButton( IDC_TOGGLEWARP, L"Toggle WARP (F4)", 0, iY += iYo, 170, 22, VK_F4 );
g_SampleUI.SetCallback( OnGUIEvent ); iY = 10;
}