Sign in to follow this  

[SlimDX] How do I load a 3d texture? (C#, DX10)

Recommended Posts

Hallo, I want to load a 3D texture in C# with SlimDX and DirectX10. The fileformat is a custom one and I read the file into a byte array. What I tried is creating a Texture3DDescription with proper values and then use that to create a Texture3D. To fill the texture with data I tried to call the Map function but always get the same error: E_INVALIDARG.
DX10.Texture3DDescription tex3Ddes = new DX10.Texture3DDescription();
tex3Ddes.Width = sizeX;
tex3Ddes.Height = sizeY;
tex3Ddes.Depth = sizeZ;
tex3Ddes.Format = DXGI.Format.R8_SInt;

tex3D = new DX10.Texture3D(device, tex3Ddes);
tex3D.Map(0, DX10.MapMode.Read, DX10.MapFlags.None);

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this