managed-directx

Creating a texture from a image in DX 12 VC++

给你一囗甜甜゛ 提交于 2019-12-13 08:52:44
问题 I just want know Directx 12 API to create texture from image. For DX11 it is D3DX11CreateShaderResourceViewFromFile and for DX9 it is D3DXCreateTextureFromFileEx and for DX12 ? 回答1: Things are a little bit better by now. Microsoft rewrote their DDSTextureLoader for DX12 and released it as part of their MiniEngine on GitHub https://github.com/Microsoft/DirectX-Graphics-Samples/blob/master/MiniEngine/Core/DDSTextureLoader.cpp You also may want to take a look at my derivative work that is

Managed DirectX: Specifying the Depth (Z-Order) of Sprites containing Texture and Text

对着背影说爱祢 提交于 2019-12-08 11:22:41
问题 I am using managed DirectX to try and draw a texture and a piece of text to the screen using a Sprite. Unfortunately, if I place the text and the texture in the same sprite, the texture overwrites (overdraws?) the text regardless of the order I do the draw commands. Since I will eventually want to intersperse textures and text, how do I specify a Z-order for these sprites. Does each layer have to be in a separate sprite? Here is the current code: m_device.BeginScene(); m_device.Clear

Why this code throws System.ExecutionEngineException

馋奶兔 提交于 2019-12-04 09:20:54
问题 Background: I am using DirectX 9.0 Managed Libraries to transform arrays of 3d points to 2d screen coordinates. For speed I use the UnsafeNativeMethods to do all the transformations. The Problem: If my custom line clipping function is used my application dies without throwing any exceptions, it took me a while to figure out that it was throwing an uncatchable System.ExecutionEngineException . I have narrowed it down to happening because of the last two lines of my clipping function. List

Why this code throws System.ExecutionEngineException

╄→гoц情女王★ 提交于 2019-12-03 03:25:46
Background: I am using DirectX 9.0 Managed Libraries to transform arrays of 3d points to 2d screen coordinates. For speed I use the UnsafeNativeMethods to do all the transformations. The Problem: If my custom line clipping function is used my application dies without throwing any exceptions, it took me a while to figure out that it was throwing an uncatchable System.ExecutionEngineException . I have narrowed it down to happening because of the last two lines of my clipping function. List<Vector3> verticesAfterClipping = new List<Vector3>; public unsafe void ClipLine(Line lineToClip) { this