I've got an interesting situation here. I'm writing a jar-library in java which wraps many of the core processing functionality for a college course I'm taking (this wasn't an assignment, just an individual undertaking I was interested in doing). So far everything has been fairly hunky-dory with wrapping the core.jar, but recently I've run into a bit of an issue with loading OpenGL.
I understand (and have tested) that using OpenGL via processing's java lib is as simple as extending PApplet, calling "size(x, y, OPENGL)" and making sure there is an appended java.library.path variable to the VM which points to the location of the native OpenGL libs (gluegen-rt, jogl, jogl_awt and jogl_cg).
However, I'd like to make it simpler. In an effort to do so, I'm attempting to write a object which extends PApplet, and overrides the init method, (ensuring the super class init is called first, obviously) such that I can determine the right native library based on architecture (.so, ,jnilib or .dll), extract those from -my- jar, and load them into the library path at runtime.
That way, writing an OpenGL applet in java, using the processing core jar is as simple as extending the custom applet instead of having to go through physical file extraction, movement, and VM argument assertion steps.
This has all worked fantastically so far with the exception of one library: jogl_cg.
When loading this particular library at runtime, I get an UnsatisfiedLinkageError, telling me that java can't find jogl_cg's dependent libraries.
My question is, why does the shader library and OpenGL function just fine when I run an applet with the VM argument: "-Djava.library.path=<library path of natives>", but has problems when I load them at runtime?
What voodoo magic is processing doing to resolve this dependency, and furthermore, does anyone actually know what this dependency is? I would imagine that it's somewhere relative to the executable, or the main processing application would have no way to use jogl_cg in the first place.
Thanks in advance for any help, suggestions or advice.