本文整理汇总了C++中CDXUTDialog::GetRadioButton方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXUTDialog::GetRadioButton方法的具体用法?C++ CDXUTDialog::GetRadioButton怎么用?C++ CDXUTDialog::GetRadioButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXUTDialog
的用法示例。
在下文中一共展示了CDXUTDialog::GetRadioButton方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}
示例2: MouseProc
void CALLBACK MouseProc(bool bLeftButtonDown, bool bRightButtonDown, bool bMiddleButtonDown, bool bSideButton1Down, bool bSideButton2Down, int nMouseWheelDelta, int xPos, int yPos, void* pUserContext)
{
if(bLeftButtonDown)
{
NsCell cell = g_Board.GetCellAtPoint(DXUTGetD3D9Device(), xPos, yPos);
g_Board.PerformMove(g_Board.GetActiveColor(), cell.iRow, cell.iColumn);
if(g_Board.pRenjuGame->bGameIsFinished)
{
g_HUD.GetButton(IDC_RESETGAME)->SetText(L"Start");
g_SampleUI.GetRadioButton(IDC_GAMEMODE_HUMAN_HUMAN_RADIO)->SetVisible(true);
g_SampleUI.GetRadioButton(IDC_GAMEMODE_AI_IS_BLACK_RADIO)->SetVisible(true);
g_SampleUI.GetRadioButton(IDC_GAMEMODE_AI_IS_WHITE_RADIO)->SetVisible(true);
}
}
}
示例3: 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 );
}
示例4: InitApp
//--------------------------------------------------------------------------------------
// Initialize the app
//--------------------------------------------------------------------------------------
void InitApp()
{
static const XMVECTORF32 s_vLightDir = { -1.f, 1.f, -1.f, 0.f };
XMVECTOR vLightDir = XMVector3Normalize( s_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 = 25;
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_HUD.AddButton( IDC_TOGGLEWIRE, L"Toggle Wires (F4)", 0, iY += 26, 170, 22, VK_F4 );
// Material Controls
iY = 10;
g_SampleUI.AddRadioButton( IDC_MATERIAL_PLASTIC, IDC_MATERIAL_GROUP, L"Plastic", 0, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_MATERIAL_PLASTIC_TEXTURED, IDC_MATERIAL_GROUP, L"Plastic Textured", 0, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_MATERIAL_ROUGH, IDC_MATERIAL_GROUP, L"Rough", 0, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_MATERIAL_ROUGH_TEXTURED, IDC_MATERIAL_GROUP, L"Rough Textured", 0, iY += 26, 170, 22 );
auto pRadioButton = g_SampleUI.GetRadioButton( IDC_MATERIAL_PLASTIC_TEXTURED );
pRadioButton->SetChecked( true );
iY += 24;
// Lighting Controls
g_SampleUI.AddRadioButton( IDC_LIGHT_CONST_AMBIENT, IDC_AMBIENT_LIGHTING_GROUP, L"Constant Ambient", 0, iY += 26, 170, 22 );
g_SampleUI.AddRadioButton( IDC_LIGHT_HEMI_AMBIENT, IDC_AMBIENT_LIGHTING_GROUP, L"Hemi Ambient", 0, iY += 26, 170, 22 );
pRadioButton = g_SampleUI.GetRadioButton( IDC_LIGHT_CONST_AMBIENT );
pRadioButton->SetChecked( true );
g_SampleUI.AddCheckBox( IDC_LIGHT_DIRECT, L"Direct Lighting", 0, iY += 26, 170, 22, g_bDirectLighting );
g_SampleUI.AddCheckBox( IDC_LIGHTING_ONLY, L"Lighting Only", 0, iY += 26, 170, 22, g_bLightingOnly );
g_SampleUI.SetCallback( OnGUIEvent );
}
示例5: OnGUIEvent
void CALLBACK OnGUIEvent(UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext)
{
switch(nControlID)
{
case IDC_TOGGLEFULLSCREEN:
DXUTToggleFullScreen();
break;
case IDC_TOGGLEREF:
DXUTToggleREF();
break;
case IDC_HIDECONSOLE:
NsConsole::Instance()->Toogle();
break;
case IDC_RESETGAME:
if(!g_Board.pRenjuGame->bGameIsFinished)
{
g_Board.Finish();
NsConsole::Instance()->AddMessage("The game was finished mannualy");
g_HUD.GetButton(IDC_RESETGAME)->SetText(L"Start");
g_SampleUI.GetRadioButton(IDC_GAMEMODE_HUMAN_HUMAN_RADIO)->SetVisible(true);
g_SampleUI.GetRadioButton(IDC_GAMEMODE_AI_IS_BLACK_RADIO)->SetVisible(true);
g_SampleUI.GetRadioButton(IDC_GAMEMODE_AI_IS_WHITE_RADIO)->SetVisible(true);
}
else
{
g_Board.Start();
g_HUD.GetButton(IDC_RESETGAME)->SetText(L"Finish");
g_SampleUI.GetRadioButton(IDC_GAMEMODE_HUMAN_HUMAN_RADIO)->SetVisible(false);
g_SampleUI.GetRadioButton(IDC_GAMEMODE_AI_IS_BLACK_RADIO)->SetVisible(false);
g_SampleUI.GetRadioButton(IDC_GAMEMODE_AI_IS_WHITE_RADIO)->SetVisible(false);
}
break;
case IDC_GAMEMODE_HUMAN_HUMAN_RADIO:
g_Board.pRenjuGame->SetNsGameMode(NsGameMode::Human_Human);
break;
case IDC_GAMEMODE_AI_IS_BLACK_RADIO:
g_Board.pRenjuGame->SetNsGameMode(NsGameMode::AI_Black);
break;
case IDC_GAMEMODE_AI_IS_WHITE_RADIO:
g_Board.pRenjuGame->SetNsGameMode(NsGameMode::AI_White);
break;
case IDC_LAUNCH_RENJU_MANUAL:
HINSTANCE hiResult = ShellExecute(
NULL,
L"open",
(NsD3DResourceManager::Instance()->GetAbsoluteContentFolderPath() + L"/Other/renju_manual.pdf").c_str(),
NULL,
NULL,
SW_SHOWNORMAL);
if((int)hiResult > 32)
{
NsConsole::Instance()->AddMessage("The manual was shown");
}
else
{
NsConsole::Instance()->AddMessage("Warning! Fail to show manual");
}
break;
}
}