Hello all,
Fast background: Experienced programmer, new to Spine; my aim is to render some Spine content as part of something else. I already have a functional Blender workflow for creating content which I can render and animate programmatically, though Spine would be greatly preferred in this case if I can get it working.
I'm using LWJGL, though not the libgdx library specifically. I do have the Spine runtime examples working with spine-libgdx in a test project, and I have adapted that as far as rendering to a separate target (rather than as a single application), though proceeding to scrape that and feed into a frame buffer in my own OpenGL context would be very inefficient and probably fraught with problems.
While I gather that the correct option in theory is to translate/port/re-implement the entire package (i.e. all of com.esotericsoftware.spine), I'm hoping for something faster for now, and I'm not against having libgdx loaded alongside everything else just for providing Spine output. My thoughts are -
- Is there a good way to setup/extend libgdx so that it can use an existing OpenGL context (and be called from the existing thread, of course)?
- Is libgdx wedded to using an Application (e.g. LwjglApplication) and a listener with specific methods for workflow (create, render...), or can it be adapted just to handle loading/unloading assets and making only the GL draw calls?
- Would the fastest route be to pick through com.esotericsoftware.spine and remove/replace all usage of libgdx?
- Without a generic Java implementation, would it be better to abandon the above and instead try to build one of the generic runtimes into a native to be loaded dynamically?
The hope is that it can be called up as-and-when, and 'just draw' without worrying about my projection/model transforms or whether it's drawing to an FBO - perhaps by making it a version of the GL20 interface with pass-throughs for the GL calls (which seems to me to be equivalent to having a generic Spine runtime in Java as long as one is willing to load libgdx on the side), or perhaps just by ensuring that everything is using only one central LWJGL library.
Cheers for any pointers!