本文整理汇总了C++中CD3DSettingsDlg::IsActive方法的典型用法代码示例。如果您正苦于以下问题:C++ CD3DSettingsDlg::IsActive方法的具体用法?C++ CD3DSettingsDlg::IsActive怎么用?C++ CD3DSettingsDlg::IsActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CD3DSettingsDlg
的用法示例。
在下文中一共展示了CD3DSettingsDlg::IsActive方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderPreFrame
//--------------------------------------------------------------------------------------
// Render the scene using the D3D11 device
//--------------------------------------------------------------------------------------
void CALLBACK OnD3D11FrameRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime,
float fElapsedTime, void* pUserContext )
{
XMMATRIX matView = XMLoadFloat4x4A( &g_matView );
XMMATRIX matProj = XMLoadFloat4x4A( &g_matProjection );
XMMATRIX matVP = matView * matProj;
RenderPreFrame( pd3dDevice, pd3dImmediateContext, matView, matProj, fElapsedTime );
// If the settings dialog is being shown, then render it instead of rendering the app's scene
if( g_SettingsDlg.IsActive() )
{
g_SettingsDlg.OnRender( fElapsedTime );
return;
}
if( g_bDrawTerrain )
{
g_pTerrainView->Render( pd3dImmediateContext );
}
else
{
RenderTestObjects( pd3dImmediateContext, matVP );
}
RenderHUD( pd3dImmediateContext, fElapsedTime );
static DWORD dwTimefirst = GetTickCount();
if ( GetTickCount() - dwTimefirst > 5000 )
{
OutputDebugString( DXUTGetFrameStats( DXUTIsVsyncEnabled() ) );
OutputDebugString( L"\n" );
dwTimefirst = GetTickCount();
}
}
示例2: RenderText
//--------------------------------------------------------------------------------------
// Render the scene using the D3D11 device
//--------------------------------------------------------------------------------------
void CALLBACK OnD3D11FrameRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime,
FLOAT fElapsedTime, void* pUserContext )
{
UNREFERENCED_PARAMETER(pUserContext);
UNREFERENCED_PARAMETER(pd3dDevice);
UNREFERENCED_PARAMETER(fTime);
if( g_D3DSettingsDlg.IsActive() )
{
g_D3DSettingsDlg.OnRender( fElapsedTime );
return;
}
auto pRTV = DXUTGetD3D11RenderTargetView();
// Clear color
pd3dImmediateContext->ClearRenderTargetView( pRTV, Colors::DimGray );
// Start the frame
g_Scene.InitFrame(&g_ViewerCamera, &g_LightCamera);
// Draw Shadows
g_Scene.RenderShadowCascades( &g_MeshPowerPlant );
// Render the GBuffer
g_Scene.RenderGBuffer(&g_MeshPowerPlant);
// Process the light linked list
g_Scene.ProcessLinkedList();
// Composite the scene
g_Scene.CompositeScene(pRTV);
// Blended elements
g_Scene.DrawAlpha(&g_TeapotMesh);
// End the frame
g_Scene.EndFrame(pRTV);
// Hud
{
D3D11_VIEWPORT vp;
vp.Width = (FLOAT)DXUTGetDXGIBackBufferSurfaceDesc()->Width;
vp.Height = (FLOAT)DXUTGetDXGIBackBufferSurfaceDesc()->Height;
vp.MinDepth = 0;
vp.MaxDepth = 1;
vp.TopLeftX = 0;
vp.TopLeftY = 0;
pd3dImmediateContext->RSSetViewports( 1, &vp);
pd3dImmediateContext->OMSetRenderTargets( 1, &pRTV, nullptr );
DXUT_BeginPerfEvent( DXUT_PERFEVENTCOLOR, L"HUD / Stats" );
g_HUD.OnRender( fElapsedTime );
g_SampleUI.OnRender( fElapsedTime );
RenderText();
DXUT_EndPerfEvent();
}
}
示例3: OnGUIEvent
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
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_CHANGEDEVICE:
g_SettingsDlg.SetActive( !g_SettingsDlg.IsActive() );
break;
case IDC_DISABLEALBEDO:
g_DisableAlbedo = ((CDXUTCheckBox*)pControl )->GetChecked();
break;
case IDC_PAUSEANIMATION:
g_PauseAnimation = ((CDXUTCheckBox*)pControl )->GetChecked();
break;
case IDC_SHOWNORMALS:
g_ShowNormals = ((CDXUTCheckBox*)pControl )->GetChecked();
break;
case IDC_DISABLESKINING:
g_DisableSkining = ((CDXUTCheckBox*)pControl )->GetChecked();
break;
case IDC_TECHNIQUECOMBO:
g_TechniqueIndex = ((CDXUTComboBox* )pControl)->GetSelectedIndex();
break;
}
}
示例4: OnGUIEvent
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
void CALLBACK OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl,
void* pUserContext )
{
if( g_bGuiVisible )
{
switch( nControlID )
{
case IDC_TOGGLEFULLSCREEN:
DXUTToggleFullScreen(); break;
case IDC_TOGGLEREF:
DXUTToggleREF(); break;
case IDC_CHANGEDEVICE:
g_D3DSettingsDlg.SetActive( !g_D3DSettingsDlg.IsActive() ); break;
case IDC_SUNWIDTH_SLIDER:
WCHAR temp[64];
int iVal = g_HUD.GetSlider( IDC_SUNWIDTH_SLIDER )->GetValue();
g_fSunWidth = ( float( iVal ) / 100.0f ) * 3.0f;
swprintf_s( temp, L"SunWidth = %2.2f", g_fSunWidth );
g_HUD.GetStatic( IDC_SUNWIDTH_TEXT )->SetText( temp );
break;
}
}
}
示例5: OnGUIEvent
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
void CALLBACK OnGUIEvent( UINT nEvent, INT nControlID, CDXUTControl* pControl, void* pUserContext )
{
UNREFERENCED_PARAMETER(pUserContext);
UNREFERENCED_PARAMETER(pControl);
UNREFERENCED_PARAMETER(nEvent);
switch( nControlID )
{
case IDC_TOGGLEFULLSCREEN:
DXUTToggleFullScreen(); break;
case IDC_TOGGLEWARP:
DXUTToggleWARP(); break;
case IDC_CHANGEDEVICE:
g_D3DSettingsDlg.SetActive( !g_D3DSettingsDlg.IsActive() ); break;
break;
case IDC_TOGGLEDYNAMICLIGHTS:
{
g_Scene.m_DynamicLights = !g_Scene.m_DynamicLights;
break;
}
case IDC_DEBUGRENDERING:
{
g_Scene.m_DebugRendering = (DebugRendering)PtrToUlong( g_DebugRenderingCombo->GetSelectedData() );
break;
}
}
}
示例6: MsgProc
//--------------------------------------------------------------------------------------
// Before handling window messages, DXUT passes incoming windows
// messages to the application through this callback function. If the application sets
// *pbNoFurtherProcessing to TRUE, then DXUT will not process this message.
//--------------------------------------------------------------------------------------
LRESULT CALLBACK MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing,
void* pUserContext )
{
// Always allow dialog resource manager calls to handle global messages
// so GUI state is updated correctly
*pbNoFurtherProcessing = g_DialogResourceManager.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
if( g_SettingsDlg.IsActive() )
{
g_SettingsDlg.MsgProc( hWnd, uMsg, wParam, lParam );
return 0;
}
// Give the dialogs a chance to handle the message first
*pbNoFurtherProcessing = g_HUD.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
*pbNoFurtherProcessing = g_SampleUI.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
// Pass all remaining windows messages to camera so it can respond to user input
g_Camera.HandleMessages( hWnd, uMsg, wParam, lParam );
g_LightControl.HandleMessages( hWnd, uMsg, wParam, lParam );
return 0;
}
示例7: OnGUIEvent
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
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_CHANGEDEVICE:
g_D3DSettingsDlg.SetActive( !g_D3DSettingsDlg.IsActive() ); break;
case IDC_SHOWTESSELLATED:
g_bShowTessellated = !g_bShowTessellated;
break;
case IDC_PARTITIONING_INTEGER:
g_Tessellator.SetPartitioningMode( CTessellator::PARTITIONING_MODE_INTEGER );
break;
case IDC_PARTITIONING_POW2:
g_Tessellator.SetPartitioningMode( CTessellator::PARTITIONING_MODE_POW2 );
break;
case IDC_PARTITIONING_FRACTIONAL_ODD:
g_Tessellator.SetPartitioningMode( CTessellator::PARTITIONING_MODE_FRACTIONAL_ODD );
break;
case IDC_PARTITIONING_FRACTIONAL_EVEN:
g_Tessellator.SetPartitioningMode( CTessellator::PARTITIONING_MODE_FRACTIONAL_EVEN );
break;
}
}
示例8: OnFrameRender
//--------------------------------------------------------------------------------------
// Render the scene using the D3D9 device
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameRender( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext )
{
// If the settings dialog is being shown, then
// render it instead of rendering the app's scene
if( g_SettingsDlg.IsActive() )
{
g_SettingsDlg.OnRender( fElapsedTime );
return;
}
HRESULT hr;
// Clear the render target and the zbuffer
V( pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB( 0, 45, 50, 70 ), 1.0f, 0 ) );
// Render the scene
if( SUCCEEDED( pd3dDevice->BeginScene() ) )
{
UINT iPass, cPasses;
V( g_pEffect->Begin( &cPasses, 0 ) );
for( iPass = 0; iPass < cPasses; iPass++ )
{
V( g_pEffect->BeginPass( iPass ) );
V( g_Mesh.Render( pd3dDevice ) );
g_pEffect->EndPass();
}
g_pEffect->End();
RenderText();
V( g_HUD.OnRender( fElapsedTime ) );
V( pd3dDevice->EndScene() );
}
}
示例9: MsgProc
LRESULT CALLBACK MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* noFurtherProcessing,
void* userContext)
{
// Pass messages to dialog resource manager calls so GUI state is updated correctly
*noFurtherProcessing = gDialogResourceManager.MsgProc(hWnd, uMsg, wParam, lParam );
if (*noFurtherProcessing) {
return 0;
}
// Pass messages to settings dialog if its active
if (gD3DSettingsDlg.IsActive()) {
gD3DSettingsDlg.MsgProc(hWnd, uMsg, wParam, lParam);
return 0;
}
// Give the dialogs a chance to handle the message first
for (int i = 0; i < HUD_NUM; ++i) {
*noFurtherProcessing = gHUD[i].MsgProc(hWnd, uMsg, wParam, lParam);
if(*noFurtherProcessing) {
return 0;
}
}
// Pass all remaining windows messages to camera so it can respond to user input
gViewerCamera.HandleMessages(hWnd, uMsg, wParam, lParam);
return 0;
}
示例10: OnGUIEvent
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
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_CHANGEDEVICE:
g_D3DSettingsDlg.SetActive( !g_D3DSettingsDlg.IsActive() ); break;
case IDC_TOGGLEWARP:
DXUTToggleWARP(); break;
case IDC_TOGGLESPIN:
{
g_bSpinning = g_SampleUI.GetCheckBox( IDC_TOGGLESPIN )->GetChecked();
break;
}
case IDC_EXPLODE_SCALE:
{
WCHAR sz[100];
g_fExplode = ( float )( g_SampleUI.GetSlider( IDC_EXPLODE_SCALE )->GetValue() * 0.01f );
swprintf_s( sz, 100, L"Explode Amount: %0.2f", g_fExplode );
g_SampleUI.GetStatic( IDC_EXPLODE_STATIC )->SetText( sz );
g_pExplodeVariable->SetFloat( g_fExplode );
break;
}
}
}
示例11: OnGUIEvent
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
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_CHANGEDEVICE:
g_D3DSettingsDlg.SetActive( !g_D3DSettingsDlg.IsActive() ); break;
case IDC_TOGGLEWARP:
DXUTToggleWARP(); break;
case IDC_TOGGLE_BLUR:
g_bUseMotionBlur = !g_bUseMotionBlur;
break;
case IDC_RENDER_OGRE:
g_bRenderOgre = !g_bRenderOgre;
break;
case IDC_SAMPLE_COUNT:
{
CDXUTComboBox* pComboBox = ( CDXUTComboBox* )pControl;
g_MSAASampleCount = ( UINT )PtrToInt( pComboBox->GetSelectedData() );
HRESULT hr = S_OK;
ID3D10Device* pd3dDevice = DXUTGetD3D10Device();
if( pd3dDevice )
V( CreateRenderTarget( pd3dDevice, g_BackBufferWidth, g_BackBufferHeight, g_MSAASampleCount, 0 ) );
}
break;
}
}
示例12: MsgProc
//--------------------------------------------------------------------------------------
// Handle messages to the application
//--------------------------------------------------------------------------------------
LRESULT CALLBACK MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing,
void* pUserContext )
{
UNREFERENCED_PARAMETER(pUserContext);
// Pass messages to dialog resource manager calls so GUI state is updated correctly
*pbNoFurtherProcessing = g_DialogResourceManager.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
// Pass messages to settings dialog if its active
if( g_D3DSettingsDlg.IsActive() )
{
g_D3DSettingsDlg.MsgProc( hWnd, uMsg, wParam, lParam );
return 0;
}
// Give the dialogs a chance to handle the message first
*pbNoFurtherProcessing = g_HUD.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
*pbNoFurtherProcessing = g_SampleUI.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
// Pass all remaining windows messages to camera so it can respond to user input
g_ViewerCamera.HandleMessages( hWnd, uMsg, wParam, lParam );
return 0;
}
示例13: OnGUIEvent
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
void CALLBACK OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext )
{
CDXUTComboBox* pComboBox = NULL;
CDXUTComboBox* pAABBLevelComboBox = NULL;
switch( nControlID )
{
case IDC_TOGGLEFULLSCREEN:
DXUTToggleFullScreen(); break;
case IDC_TOGGLEWARP:
DXUTToggleWARP(); break;
case IDC_TOGGLEREF:
DXUTToggleREF(); break;
case IDC_CHANGEDEVICE:
g_SettingsDlg.SetActive( !g_SettingsDlg.IsActive() ); break;
case IDC_SCENERASTERIZER_MODE:
//CDXUTComboBox* pComboBox = NULL;
pComboBox = ( CDXUTComboBox* )pControl;
g_eSceneRasterizerMode = ( UINT )PtrToInt( pComboBox->GetSelectedData() );
break;
case IDC_AABBSUBLEVEL:
pAABBLevelComboBox = ( CDXUTComboBox* )pControl;
g_CurrentAABBLevel = ( UINT )PtrToInt( pAABBLevelComboBox->GetSelectedData() );
break;
}
}
示例14: MsgProc
// Handle messages to the application
LRESULT CALLBACK MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing,
void* pUserContext )
{
// Pass messages to dialog resource manager calls so GUI state is updated correctly
*pbNoFurtherProcessing = gDialogResourceManager.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
// Pass messages to settings dialog if its active
if( gD3DSettingsDlg.IsActive() )
{
gD3DSettingsDlg.MsgProc( hWnd, uMsg, wParam, lParam );
return 0;
}
// Give the dialogs a chance to handle the message first
*pbNoFurtherProcessing = gHUD.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
*pbNoFurtherProcessing = gSampleUI.MsgProc( hWnd, uMsg, wParam, lParam );
if( *pbNoFurtherProcessing )
return 0;
return 0;
}
示例15: OnFrameRender
//--------------------------------------------------------------------------------------
// This callback function will be called at the end of every frame to perform all the
// rendering calls for the scene, and it will also be called if the window needs to be
// repainted. After this function has returned, DXUT will call
// IDirect3DDevice9::Present to display the contents of the next buffer in the swap chain
//--------------------------------------------------------------------------------------
void CALLBACK OnFrameRender( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext )
{
// If the settings dialog is being shown, then
// render it instead of rendering the app's scene
if( g_SettingsDlg.IsActive() )
{
g_SettingsDlg.OnRender( fElapsedTime );
return;
}
HRESULT hr;
D3DXMATRIXA16 mWorld;
D3DXMATRIXA16 mView;
D3DXMATRIXA16 mProj;
D3DXMATRIXA16 mWorldViewProjection;
// Clear the render target and the zbuffer
V( pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB( 0, 141, 153, 191 ), 1.0f, 0 ) );
// Render the scene
if( SUCCEEDED( pd3dDevice->BeginScene() ) )
{
// Get the projection & view matrix from the camera class
mWorld = *g_Camera.GetWorldMatrix();
mView = *g_Camera.GetViewMatrix();
mProj = *g_Camera.GetProjMatrix();
mWorldViewProjection = mWorld * mView * mProj;
// Update the effect's variables.
V( g_pEffect->SetMatrix( g_hWorldViewProjection, &mWorldViewProjection ) );
V( g_pEffect->SetMatrix( g_hWorld, &mWorld ) );
V( g_pEffect->SetFloat( g_hTime, ( float )fTime ) );
V( g_pEffect->SetValue( g_hCameraPosition, g_Camera.GetEyePt(), sizeof( D3DXVECTOR3 ) ) );
UINT iCurSubset = ( UINT )( INT_PTR )g_SampleUI.GetComboBox( IDC_SUBSET )->GetSelectedData();
// A subset of -1 was arbitrarily chosen to represent all subsets
if( iCurSubset == -1 )
{
// Iterate through subsets, changing material properties for each
for( UINT iSubset = 0; iSubset < g_MeshLoader.GetNumMaterials(); iSubset++ )
{
RenderSubset( iSubset );
}
}
else
{
RenderSubset( iCurSubset );
}
RenderText();
V( g_HUD.OnRender( fElapsedTime ) );
V( g_SampleUI.OnRender( fElapsedTime ) );
V( pd3dDevice->EndScene() );
}
}