• Advertisement
Sign in to follow this  

Help needed for Animation with AnimationCallback: AccessViolationException

This topic is 2216 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

could someone provide me a small DirectX9 SlimDX sample application that uses an AnimationCallback delegate in animationController.AdvanceTime(...)?

I converted my project (too big to post, sorry) from MDX to SlimDX (DirectX9), but I get an AccessViolationException when calling this.animationController.AdvanceTime(elapsedTime, myAnimCallbackHandler);
The debug runtimes don't tell me anything either and I'm quite lost now.

I'm putting a small structure (myCbData) in the CallbackKey.Data when I create the animation set. In MDX, I had to get an IntPtr to this data by using


GCHandle handle = GCHandle.Alloc(myCbData, GCHandleType.Pinned);
theCallbackKey.Data = handle.AddrOfPinnedObject();


The CallbackKey.Data in SlimDX is still an IntPtr, so I guess my code is still usable (?).

On the other hand, the AnimationCallback delegate in SlimDX now returns the callback data as a System.Object instead of an IntPtr, which seems quite odd. Are the object handles pinned internally? But how to get the IntPtr to my structure then?
Are the animation callbacks fully functional in SlimDX, or is there still some work to do?

Thanks for your time,

Lars

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement