martindevans / SupersonicSound

C# Wrapper For FMOD Studio
Other
29 stars 9 forks source link

Windows x64 support #10

Open martindevans opened 9 years ago

martindevans commented 9 years ago

Currently the DLL loader on windows does not load the 64 bit dependencies when loaded into a 64 bit process.

This code always throws when the process is compiled as x64:

var ptr = LoadLibrary(path);
if (ptr == IntPtr.Zero)
    throw new DllNotFoundException(string.Format("Failed to load DLL '{0}'. See https://github.com/martindevans/SupersonicSound#installation-instructions", path));

Even when it is being pointed at 64 bit DLLs. Loader has been modified to throw a NotImplementedException when loaded in a 64 bit process until this is resolved.

martindevans commented 9 years ago

This is probably because the "WIN64" symbol which the primitive FMOD C# wrapper depends upon is never defined!

christopherpross commented 6 years ago

Hello, I read a blog article, where the author discribe the problem, maybe it can help here? https://mysteriousspace.com/2015/05/31/fmod-in-c-its-a-pain-to-set-up-heres-how-i-did-it/

It would be very nice, if I can use your wrapper also in 64 bit windows...

galead commented 5 years ago

ConsoleTest project runs perfectly and plays sounds under x64 if you make few minor changes: 1) Copy fmod64.dll and fmodstudio64.dll to the "Dependencies\x86_64" folder. I just modified CopyFromFModInstall.bat and used it. 2) Added WIN64 symbol to SupersonicSound project settings. 3) I set it up in the PlatformTarget project settings: AnyCPU, unchecked "Prefer 32-bit". 4) Commented out the line //throw new NotImplementedException("Loading DLLs for x64 not in Native.cs file.

martindevans commented 5 years ago

Nice! Would you like to make a Pull Request with these changes?