Slim Dx Version 4.0 13.43 Hot! -
Slim DX version 4.0!
class Program { private static Device _device; private static SwapChain _swapChain; private static Texture2D _texture; private static ShaderResourceView _textureView; slim dx version 4.0 13.43
// 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)), }; Slim DX version 4
context.InputAssembler.InputLayout = InputLayout.FromDescription(_device, typeof(Vertex), new[] { new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0), new InputElement("TEXCOORD", 0, Format.R32G32_Float, 12, 0) }); private static SwapChain _swapChain
static void Main(string[] args) { // Create the device and swap chain var windowHandle = System.Windows.Forms.Application.OpenForms[0].Handle; var desc = new SwapChainDescription() { BufferCount = 1, IsWindowed = true, ModeDescription = new ModeDescription(800, 600, new Rational(60, 1), Format.R8G8B8A8_UNorm), OutputHandle = windowHandle, SampleDescription = new SampleDescription(1, 0), Usage = Usage.RenderTargetOutput };