Sign in to follow this  
adt7

[SlimDX] Mesh.Clone (D3DERR_INVALIDCALL: Invalid call (-2005530516)) [Solved]

Recommended Posts

I'm currently having issues with the Mesh.Clone method in SlimDX. I've reduced my code down to the simplest possible form to try and troubleshoot, but I just can't see what's wrong.
mesh = Mesh.FromFile(d3dDevice, filename, MeshFlags.SystemMemory);
VertexElement[] elements = mesh.GetDeclaration();

Mesh temp;
temp = mesh.Clone(d3dDevice, MeshFlags.SystemMemory, elements);



This work fine with a very simple box mesh, but when I try it with anything else (for example the Stanford dragon), I get D3DERR_INVALIDCALL: Invalid call (-2005530516) on the mesh.Clone line. The debug runtimes don't come up with anything, although I do get the following in my output window:
A first chance exception of type 'SlimDX.Direct3D9.Direct3D9Exception' occurred in SlimDX.dll
An unhandled exception of type 'SlimDX.Direct3D9.Direct3D9Exception' occurred in SlimDX.dll

Additional information: D3DERR_INVALIDCALL: Invalid call (-2005530516)


I'm completely lost with this, surely cloning a mesh with exactly the same elements shouldn't cause a problem. [Edited by - adt7 on August 17, 2009 11:43:31 AM]

Share this post


Link to post
Share on other sites
I can't be the only person in the world using the Mesh.Clone method.

EDIT: ... and I've just figured it out, I needed MeshFlags.Use32Bit.

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