Graphics Reference
In-Depth Information
2. Select the shader file in the Solution Explorer and select Copy if newer for the
Copy to Output Directory setting within the Properties window.
3.
In our project, let's add a new class called D3DApp , which is descending from
D3DApplicationDesktop (note the additional using directives):
using SharpDX;
using SharpDX.Windows;
using SharpDX.DXGI;
using SharpDX.Direct3D11;
using SharpDX.D3DCompiler;
using Common;
using Buffer = SharpDX.Direct3D11.Buffer;
public class D3DApp: D3DApplicationDesktop
{
public PrimitivesApp(System.Windows.Forms.Form window)
: base(window)
{ }
...
}
4.
We will include the following private member fields:
// The vertex shader
ShaderBytecode vertexShaderBytecode;
VertexShader vertexShader;
// The pixel shader
ShaderBytecode pixelShaderBytecode;
PixelShader pixelShader;
// The vertex layout for the IA
InputLayout vertexLayout;
// A buffer that will be used to update the constant buffer
// used by the vertex shader. This contains our
// worldViewProjection matrix
Buffer worldViewProjectionBuffer;
// Our depth stencil state
DepthStencilState depthStencilState;
 
Search WWH ::




Custom Search