本文整理汇总了C++中CDXUTDialogResourceManager::OnD3D10ResizedSwapChain方法的典型用法代码示例。如果您正苦于以下问题:C++ CDXUTDialogResourceManager::OnD3D10ResizedSwapChain方法的具体用法?C++ CDXUTDialogResourceManager::OnD3D10ResizedSwapChain怎么用?C++ CDXUTDialogResourceManager::OnD3D10ResizedSwapChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDXUTDialogResourceManager
的用法示例。
在下文中一共展示了CDXUTDialogResourceManager::OnD3D10ResizedSwapChain方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DXUTGetDXGIBackBufferSurfaceDesc
//--------------------------------------------------------------------------------------
// Create any D3D10 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D10ResizedSwapChain(ID3D10Device* pd3dDevice,
IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext)
{
HRESULT hr;
V_RETURN(g_DialogResourceManager.OnD3D10ResizedSwapChain(pd3dDevice,
pBackBufferSurfaceDesc));
V_RETURN(g_D3DSettingsDlg.OnD3D10ResizedSwapChain(pd3dDevice,
pBackBufferSurfaceDesc));
// Setup the camera's projection parameters
float fAspectRatio =
1.0;//pBackBufferSurfaceDesc->Width / (FLOAT)pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams(D3DX_PI / 4, fAspectRatio, 0.1f, 10.0f);
g_Camera.SetWindow(pBackBufferSurfaceDesc->Width,
pBackBufferSurfaceDesc->Height);
g_Camera.SetButtonMasks(MOUSE_RIGHT_BUTTON, MOUSE_WHEEL, MOUSE_MIDDLE_BUTTON);
g_HUD.SetLocation(pBackBufferSurfaceDesc->Width - 170, 0);
g_HUD.SetSize(170, 170);
g_SampleUI.SetLocation(pBackBufferSurfaceDesc->Width - 170,
pBackBufferSurfaceDesc->Height - 300);
g_SampleUI.SetSize(170, 300);
// resize the texture so that it fits to the current screen size
UINT width = (DXUTIsAppRenderingWithD3D9()) ?
DXUTGetD3D9BackBufferSurfaceDesc()->Width :
DXUTGetDXGIBackBufferSurfaceDesc()->Width;
UINT height = (DXUTIsAppRenderingWithD3D9()) ?
DXUTGetD3D9BackBufferSurfaceDesc()->Height :
DXUTGetDXGIBackBufferSurfaceDesc()->Height;
g_vsObj->SetupTextures(pd3dDevice, g_pEffect10, width, height);
return S_OK;
}
示例2: UpdateMSAASampleCounts
//--------------------------------------------------------------------------------------
// Create any D3D10 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D10SwapChainResized( ID3D10Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr = S_OK;
V_RETURN( g_DialogResourceManager.OnD3D10ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
V_RETURN( g_D3DSettingsDlg.OnD3D10ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
// Setup the camera's projection parameters
float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams( 60.0f * ( D3DX_PI / 180.0f ), fAspectRatio, 0.1f, 100.0f );
g_Camera.SetWindow( pBackBufferSurfaceDesc->Width, pBackBufferSurfaceDesc->Height );
g_Camera.SetButtonMasks( MOUSE_LEFT_BUTTON, MOUSE_WHEEL, MOUSE_MIDDLE_BUTTON );
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 300 );
g_SampleUI.SetSize( 170, 300 );
// Update the sample count
UpdateMSAASampleCounts( pd3dDevice, pBackBufferSurfaceDesc->Format );
// Create a render target
g_BackBufferWidth = pBackBufferSurfaceDesc->Width;
g_BackBufferHeight = pBackBufferSurfaceDesc->Height;
V_RETURN( CreateRenderTarget( pd3dDevice, g_BackBufferWidth, g_BackBufferHeight, g_MSAASampleCount, 0 ) );
return hr;
}
示例3:
//--------------------------------------------------------------------------------------
// Create any D3D10 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D10ResizedSwapChain( ID3D10Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D10ResizedSwapChain( pd3dDevice, pBufferSurfaceDesc ) );
V_RETURN( g_SettingsDlg.OnD3D10ResizedSwapChain( pd3dDevice, pBufferSurfaceDesc ) );
// Setup the camera's projection parameters
float fAspectRatio = pBufferSurfaceDesc->Width / ( FLOAT )pBufferSurfaceDesc->Height;
g_Camera.SetProjParams( D3DX_PI / 4, fAspectRatio, 0.1f, 1000.0f );
g_Camera.SetWindow( pBufferSurfaceDesc->Width, pBufferSurfaceDesc->Height );
g_HUD.SetLocation( pBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBufferSurfaceDesc->Width - 170, pBufferSurfaceDesc->Height - 350 );
g_SampleUI.SetSize( 170, 300 );
return S_OK;
}
示例4:
//--------------------------------------------------------------------------------------
// Create any D3D10 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D10ResizedSwapChain( ID3D10Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D10ResizedSwapChain( pd3dDevice, pBufferSurfaceDesc ) );
V_RETURN( g_D3DSettingsDlg.OnD3D10ResizedSwapChain( pd3dDevice, pBufferSurfaceDesc ) );
// Setup the camera's projection parameters
float fAspectRatio = static_cast<float>( pBufferSurfaceDesc->Width ) /
static_cast<float>( pBufferSurfaceDesc->Height );
g_Camera.SetProjParams( D3DX_PI / 4, fAspectRatio, 0.1f, 5000.0f );
g_Camera.SetWindow( pBufferSurfaceDesc->Width, pBufferSurfaceDesc->Height );
g_Camera.SetButtonMasks( MOUSE_MIDDLE_BUTTON, MOUSE_WHEEL, MOUSE_LEFT_BUTTON );
g_HUD.SetLocation( pBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBufferSurfaceDesc->Width - 170, pBufferSurfaceDesc->Height - 300 );
g_SampleUI.SetSize( 170, 300 );
return S_OK;
}
示例5: switch
//--------------------------------------------------------------------------------------
// Create any D3D10 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D10SwapChainResized( ID3D10Device* pDev10, IDXGISwapChain *pSwapChain, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr = S_OK;
V_RETURN(g_DialogResourceManager.OnD3D10ResizedSwapChain(pDev10, pBackBufferSurfaceDesc));
// setup the camera projection parameters
g_pCamManager->OnD3D10SwapChainResized( pDev10, pSwapChain, pBackBufferSurfaceDesc, pUserContext );
//light management
for( int light_idx = 0; light_idx < NUM_LIGHT; ++light_idx )
{
g_LCamera[light_idx].SetWindow(pBackBufferSurfaceDesc->Width, pBackBufferSurfaceDesc->Height);
}
g_HUD.SetLocation(pBackBufferSurfaceDesc->Width-170, 0);
g_HUD.SetSize(170, 170);
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width-300, pBackBufferSurfaceDesc->Height-700 );
g_SampleUI.SetSize( 170, 300 );
g_CameraUI.SetLocation( 0, 50 );
g_CameraUI.SetSize( 600, 600 );
switch( ShadowAlgorithm )
{
case STANDARD_BP:
g_ABP.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
break;
case BP_MSSM_KERNEL:
g_BPMSSMKernel.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
break;
case STD_VSM:
g_StdVSM.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
break;
case MIP_VSM:
g_MipVSM.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
break;
case HIR_BP:
g_HBP.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
break;
case BP_GI:
g_BPGI.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
break;
case STD_PCSS:
g_PCSS.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
break;
default:
break;
}
g_NoShadow.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
g_Final.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
g_GBuffer.OnD3D10SwapChainResized(pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext );
//light management
D3D10_TEXTURE2D_DESC rtDesc_scrpos =
{
pBackBufferSurfaceDesc->Width, //UINT Width;
pBackBufferSurfaceDesc->Height, //UINT Height;
1,//UINT MipLevels;
1,//UINT ArraySize;
DXGI_FORMAT_R16G16B16A16_FLOAT,//DXGI_FORMAT Format;
{1, 0}, //DXGI_SAMPLE_DESC SampleDesc;
D3D10_USAGE_DEFAULT, //D3D10_USAGE Usage;
D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET ,//UINT BindFlags;
0,//UINT CPUAccessFlags;
0,//UINT MiscFlags;
};
for( int light_idx = 0; light_idx < NUM_LIGHT; ++light_idx )
{
g_pLightLumiBuffer[light_idx]->OnD3D10SwapChainResized( rtDesc_scrpos, pDev10, pSwapChain, pBackBufferSurfaceDesc, pUserContext);
}
D3D10_TEXTURE2D_DESC rtDesc_blend =
{
pBackBufferSurfaceDesc->Width, //UINT Width;
pBackBufferSurfaceDesc->Height, //UINT Height;
1,//UINT MipLevels;
1,//UINT ArraySize;
DXGI_FORMAT_R16G16B16A16_FLOAT,//DXGI_FORMAT Format;
//DXGI_FORMAT_R8G8B8A8_UNORM,//DXGI_FORMAT Format;
{1, 0}, //DXGI_SAMPLE_DESC SampleDesc;
D3D10_USAGE_DEFAULT, //D3D10_USAGE Usage;
D3D10_BIND_SHADER_RESOURCE | D3D10_BIND_RENDER_TARGET ,//UINT BindFlags;
0,//UINT CPUAccessFlags;
0,//UINT MiscFlags;
};
g_pBlendBuffer->OnD3D10SwapChainResized( rtDesc_blend, pDev10, pSwapChain, pBackBufferSurfaceDesc, pUserContext);
g_pWidgetBuffer->OnD3D10SwapChainResized( rtDesc_blend, pDev10, pSwapChain, pBackBufferSurfaceDesc, pUserContext);
ssmap.OnWindowResize();
g_ScrQuadRender.OnD3D10SwapChainResized(rtDesc_scrpos,pDev10,pSwapChain,pBackBufferSurfaceDesc,pUserContext);
//---------------------------------------
//.........这里部分代码省略.........