E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809) when loading a cube texture
- by Boreal
I'm trying to implement a skybox into my engine, and I'm having some trouble loading the image as a cube map. Everything works (but it doesn't look right) if I don't load using an ImageLoadInformation struct in the ShaderResourceView.FromFile() method, but it breaks if I do.
I need to, of course, because I need to tell SlimDX to load it as a cubemap. How can I fix this?
Here is my new loading code after the "fix":
public static void LoadCubeTexture(string filename)
{
ImageLoadInformation loadInfo = ImageLoadInformation.FromDefaults();
loadInfo.OptionFlags = ResourceOptionFlags.TextureCube;
textures.Add(filename, ShaderResourceView.FromFile(Graphics.device, "Resources/" + filename, loadInfo));
}