E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809) when loading a cube texture

Posted by Boreal on Game Development See other posts from Game Development or by Boreal
Published on 2012-04-01T00:50:07Z Indexed on 2012/04/01 11:43 UTC
Read the original article Hit count: 429

Filed under:
|
|
|

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));
}

© Game Development or respective owner

Related posts about c#

Related posts about directx11