Slim Dx Version 4.0 13.43 Now
context.PixelShader.SetShaderResource(0, _textureView); context.Draw(4, 0);
struct Vertex { public Vector3 Position; public Vector2 TexCoord; slim dx version 4.0 13.43
Keep in mind that you need to have the Slim DX 4.0 libraries and the DirectX SDK installed to run this code. Also, error checking has been omitted for brevity. context
This example demonstrates how to load a texture and render a sprite using Slim DX 4.0. class Program { private static Device _device; private
class Program { private static Device _device; private static SwapChain _swapChain; private static Texture2D _texture; private static ShaderResourceView _textureView;
// Draw a sprite var sprite = new Vertex[4] { new Vertex(new Vector3(-0.5f, -0.5f, 0), new Vector2(0, 1)), new Vertex(new Vector3(0.5f, -0.5f, 0), new Vector2(1, 1)), new Vertex(new Vector3(0.5f, 0.5f, 0), new Vector2(1, 0)), new Vertex(new Vector3(-0.5f, 0.5f, 0), new Vector2(0, 0)), };