Does anyone have any experience with this? I’m about to jump headfirst into this rabbit hole.
My end goal is to target AR & VR (Augmented Reality & Virtual Reality) apps while being able to leverage the power of the JUCE audio APIs.
My initial research suggests that it’s not as simple as I would have thought to use C++ from within Unity3D (Unity is made with C++, but most of the work is done in C# via the Mono engine).
I’ve developed a simple tool (basically a simple transpiler) that converts my audio backend (using JUCE obviously) into a simple C API accessible through a Header & a static library with no other dependencies — this has worked wonders for using JUCE as an audio backend for mobile apps and other projects where JUCE is used solely for the Audio bits and everything else is done in the other programming language.
From the basic C API, it’s pretty simple to auto-generate other language bindings — so far I’ve done Objective-C, Swift, Java, & Pure Data, and I’m working on the Julia, Python,& Javascript bindings (Javascript via Emscripten — a whole can of worms in itself).
My initial impression would be that it would be best to generate a C# API built off the C API and make a Unity3D plugin from that — it’s possible to link static & dynamic libraries in Unity, and I think having the C# bindings would make things simpler.
Does anyone have any experience with this sort of thing?
I understand it’ll be a bit of work no matter what, but I really feel like it would be worth it to develop a solid workflow that allows us to leverage both of these powerful tools together. If we are successful, this could be a godsend for developers everywhere.
FWIW, I plan on open-sourcing my JUCE -> C transpiler soon (as well as C -> Other Languages), but it’s nothing fancy so far, just a simple Lex & Parser engine. I want to switch from my own home-brewed system to using the LLVM Lexing & Parsing tools, but in the meantime I have something that works pretty well, and I have a feeling that it could actually be pretty simple to hook up the raw C API into Unity3D. I just barely started using Unity3D, though, so I could use all the advice I can get!
Thanks in advance!