Slim Dx Version 4.0 13.43 | No Ads |

context.PixelShader.SetShaderResource(0, _textureView); context.Draw(4, 0);

// Load a texture using (var stream = System.IO.File.OpenRead("texture.png")) { var textureData = Texture2D.FromStream(_device, stream, ImageInformation.FromFile("texture.png")); _texture = textureData; _textureView = new ShaderResourceView(_device, _texture); }

Here's a useful piece of code to get you started: slim dx version 4.0 13.43

using SlimDX; using SlimDX.Direct3D11; using System;

class Program { private static Device _device; private static SwapChain _swapChain; private static Texture2D _texture; private static ShaderResourceView _textureView; context

// 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)), };

struct Vertex { public Vector3 Position; public Vector2 TexCoord; _texture = textureData

This example demonstrates how to load a texture and render a sprite using Slim DX 4.0.