当前位置: 首页>>代码示例>>C++>>正文


C++ CD3DSettingsDlg::OnD3D10ResizedSwapChain方法代码示例

本文整理汇总了C++中CD3DSettingsDlg::OnD3D10ResizedSwapChain方法的典型用法代码示例。如果您正苦于以下问题:C++ CD3DSettingsDlg::OnD3D10ResizedSwapChain方法的具体用法?C++ CD3DSettingsDlg::OnD3D10ResizedSwapChain怎么用?C++ CD3DSettingsDlg::OnD3D10ResizedSwapChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CD3DSettingsDlg的用法示例。


在下文中一共展示了CD3DSettingsDlg::OnD3D10ResizedSwapChain方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:maleiwhat,项目名称:vectorizing-project,代码行数:34,代码来源:VolSurfaces10.cpp

示例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;
}
开发者ID:marselas,项目名称:Zombie-Direct3D-Samples,代码行数:32,代码来源:MotionBlur10.cpp

示例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;
}
开发者ID:softwarekid,项目名称:DXFunctionDraw,代码行数:23,代码来源:MeshFromOBJ10.cpp

示例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;
}
开发者ID:KNeal,项目名称:Oculus,代码行数:25,代码来源:Tutorial13.cpp


注:本文中的CD3DSettingsDlg::OnD3D10ResizedSwapChain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。