packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/Direct3D10/Tutorials/D3D10Tutorial07_WinFormsWindow/TutorialWindow.cs
/// <summary>
/// Sets the views that depend on background buffer dimensions
/// </summary>
Sets the views that depend on background buffer dimensions
Sets the views that depend on background buffer dimensions
private void SetViews()
        {
            using (Texture2D pBuffer = swapChain.GetBuffer<Texture2D>(0))
            {
                renderTargetView = device.CreateRenderTargetView(pBuffer);
            }
            device.OM.RenderTargets = new OutputMergerRenderTargets(new RenderTargetView[] { renderTargetView });
            Viewport vp = new Viewport()
            {
                Width = (uint)ClientSize.Width,
                Height = (uint)ClientSize.Height,
                MinDepth = 0.0f,
                MaxDepth = 1.0f,
                TopLeftX = 0,
                TopLeftY = 0
            };
            device.RS.Viewports = new Viewport[] { vp };
        }
private void SetViews ( ) { using ( Texture2D pBuffer = swapChain . GetBuffer < Texture2D > ( 0 ) ) { renderTargetView = device . CreateRenderTargetView ( pBuffer ) ; } device . OM . RenderTargets = new OutputMergerRenderTargets ( new RenderTargetView [ ] { renderTargetView } ) ; Viewport vp = new Viewport ( ) { Width = ( uint ) ClientSize . Width , Height = ( uint ) ClientSize . Height , MinDepth = 0.0f , MaxDepth = 1.0f , TopLeftX = 0 , TopLeftY = 0 } ; device . RS . Viewports = new Viewport [ ] { vp } ; }
Sets the views that depend on background buffer dimensions
Sets the views that depend on background buffer dimensions
// Create a render target view //bind the render target to the device // Setup the viewport