1

I'm switching to SharpDX 3.0.0 right now. With the old SharpDX version you could load a texture from file in this way:

ShaderResourceView textureView = SharpDX.Direct3D11.Resource.FromFile<Texture2D>(device, "Texture.png");

or

ShaderResourceView textureView = ShaderResourceView.FromFile(device, "Texture.png");

But in version 3.0.0 the function FromFile is missing. How can I load textures from files with SharpDX 3?

hitzi
  • 852
  • 2
  • 10
  • 23

1 Answers1

2

You have to use the WIC API or similar methods. There is a old code TextureLoader.cs that performs a simplistic load (but doesn't handle format conversion)

xoofx
  • 3,682
  • 1
  • 17
  • 32