-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How would I use libxmp in Unity? #587
Comments
|
You need to write your own C# bindings, I guess. (I don't know anything about C#, so I can't help.) |
|
First off, I've never used C#, so I don't know what I'm talking about. I have marginal experience with the Java equivalent of this. Right, you're going to have to add native function declarations to your class that interfaces with libxmp as described here: https://docs.unity3d.com/Manual/NativePlugins.html (note: don't statically link libxmp unless your software is GPL or LGPL or you're using libxmp-lite. This seems to only matter for iOS.) Unfortunately, they don't provide much in terms of examples of how to do this, but they link to this MSDN document that seems like it should be useful: https://docs.microsoft.com/en-us/dotnet/framework/interop/marshalling-data-with-platform-invoke?redirectedfrom=MSDN The C# native interface and libxmp's API makes this a little obnoxious because it seems that C# chars are 16-bits. The This could be completely wrong, though, as it seems like there's some separate handling for unmanaged pointers, which is what you'd actually want for |
Hear back from them yet? @AliceLR |
|
No one responded either time I asked, sorry. :( |
|
I think this can be closed now. |
I'm a beginner developer, currently learning how to develop a game in Unity by developing a simple project that I plan to build upon later.
I really wanted to use some Creative-Commons-licensed tracker music composed by Andreas Viklund for my Unity project, and I decided to give this library a try because of its simple API. However, this library is coded in C and Unity uses C#, so I have to build the library into a .dll and then somehow get that running in Unity. Unity treats the .dll as a "native plugin," and the library contains several custom functions and data types.
How do I make this work?
The text was updated successfully, but these errors were encountered: