packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/Direct3D10/WindowsFlag/Window.cs
/// <summary>
/// Creates Direct3D device and swap chain,
/// Initializes buffers,
/// Loads and initializes the shader
/// </summary>
Creates Direct3D device and swap chain,
Initializes buffers,
Loads and initializes the shader
Creates Direct3D device and swap chain Initializes buffers Loads and initializes the shader
protected void InitializeDevice()
        {
            device = D3DDevice.CreateDeviceAndSwapChain(directControl.Handle);
            swapChain = device.SwapChain;
            SetViews();
            effects = new Effects(device);
            InitializeVertexLayout();
            InitializeVertexBuffer();
            InitializeIndexBuffer();
            device.IA.PrimitiveTopology = PrimitiveTopology.TriangleList;
            effects.ViewMatrix = DXUtil.Camera.MatrixLookAtLH(Eye, At, Up);
            effects.ProjectionMatrix = DXUtil.Camera.MatrixPerspectiveFovLH((float)Math.PI * 0.25f, ((float)this.ClientSize.Width / (float)this.ClientSize.Height), 0.1f, 4000.0f);
        }
protected void InitializeDevice ( ) { device = D3DDevice . CreateDeviceAndSwapChain ( directControl . Handle ) ; swapChain = device . SwapChain ; SetViews ( ) ; effects = new Effects ( device ) ; InitializeVertexLayout ( ) ; InitializeVertexBuffer ( ) ; InitializeIndexBuffer ( ) ; device . IA . PrimitiveTopology = PrimitiveTopology . TriangleList ; effects . ViewMatrix = DXUtil . Camera . MatrixLookAtLH ( Eye , At , Up ) ; effects . ProjectionMatrix = DXUtil . Camera . MatrixPerspectiveFovLH ( ( float ) Math . PI * 0.25f , ( ( float ) this . ClientSize . Width / ( float ) this . ClientSize . Height ) , 0.1f , 4000.0f ) ; }
Creates Direct3D device and swap chain,
Initializes buffers,
Loads and initializes the shader
Creates Direct3D device and swap chain Initializes buffers Loads and initializes the shader
// Set primitive topology