Open jrbudda opened 7 years ago
Hi @jrbudda!
Thanks for your input and that you find the update helpful! To answer your questions:
{texture, bounds}.write()
is crucial, otherwise the structs are not committed to memoryleftTexture.handle = Pointer.createConstant(leftId)
. This is along the lines of what the official C++ examples are doing, see https://github.com/ValveSoftware/openvr/blob/master/samples/hellovr_opengl/hellovr_opengl_main.cpp#L706System.loadLibrary()
can only load from directories, not JARs. I'll see if using plain JNA makes the whole process more difficult or not. If that isn't the case, I'll switch to that on the next bugfix release.With that being said, the LWJGL people are now also adding OpenVR support (see https://github.com/LWJGL/lwjgl3/commit/779f0104f1aa08a3b550c220c57f82138d4d6e52, apparently arriving then in v3.1.2) -- their wrapping code uses JNI, and might therefore have performance benefits, so it might be worth considering switching to that when they release it -- which I will also consider, especially as JNAerator is not being actively maintained anymore.
I hope this was helpful, let me know if you have more questions or just confused you more :-D
cheers!
Aha! yea .createConstant() did it. using an int seems to work fine but calling the library straight out of the box is always better, less work for me!
I'll give pure JNA a shot, didn't know about the jar-loading, that is convenient, maybe worth the dependency.
Sadly I have no control over the lwjgl version, I'm modding minecraft and at the mercy of Mojang. Neat that they're adding openvr, maybe someday in the future we can use that.
Trying it now. Having a problem, the resulting openvr_capi.java file is missing all the strings. All the static const char*'s in openvr_capi.h are missing. Tried jnaerator and jna, tried playing with the command, nada. Turned on -verbose mode and they're all there in the .c and .cpp outputs but not the .java. Wondering if you ran into this.
You are referring to the guys here, right? https://github.com/skalarproduktraum/scenery-openvr/blob/master/src/main/java/graphics/scenery/jopenvr/JOpenVRLibrary.java#L762
These I actually had to add manually. For some reason they didn't get picked up by JNA(erator). That's also why I made the generate-bindings.sh
script to not directly save the generated classes to src/main, but a tmp directory. Apologies, I forgot mentioning these issues in my reply :-\
yup. interesting.
Hey thanks for doing this. phr00t's was getting behind and I couldn't get jnaerator working to save my life.
Couple questions:
I couldn't get the compositor to accept textures using a Pointer as the .handle, I had to change it back to int and it started working again, is that just me doing something wrong?
is the extra dependency on jnaerator necessary? seems like it's just for com.ochafik.lang.jnaerator.runtime.Structure. JNA has a structure class but it's not generic. Is there a performance/usability issue with using the JNA structure class? is there a way to specify jnaerator not use this class?
Thanks!