Can SlimDX be used in Unity? I tried to set up a joystick but get this error when the first line runs. I thought SlimDX was mono compatible…
MissingMethodException: Method contains unsupported native code
<Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails>.LanguageSupport* )
<Module>..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for <Module>
ForceFeedbackTest.Start () (at Assets/FF/ForceFeedbackTest.cs:16)
using SlimDX.DirectInput;
using UnityEngine;
public class ForceFeedbackTest : MonoBehaviour
{
private Joystick joystick;
private JoystickState state = new JoystickState(); // This line gets the error
}
FYI: It doesn’t work. A response from gamedev.net
“Mono doesn’t have the C++/CLI support required to run SlimDX. SlimDX v2 may address this, but we don’t have a release window yet.”
So there’s some hope for force feedback from C#, but not for a while by the sound of it
Pure C# it will never happen anyway, there is always C++ involved (because the “pure C#” layers that would offer it are MS .NET exclusive, though realistically even that is just a C++ wrapper as the inheritance to marshalbyrefobject shows). Most just bind it differently so it does not have problems like SlimDX seems to have …
EDIT: to answer the question you had on your gamedev posting - unity doesn’t have it cause its windows exclusive and until last spring (09), windows was just “the other build target”, there was not even an editor, making any special support totally meaningless.
Its important to keep in mind that OSX has no standard framework for forcefeedback (if any at all) or game input handling. Microsoft went a very special way there with DirectX and what they wanted to achieve and achieved, something all *nix OS are half a decade away at least