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,