scenerygraphics / jopenvr

OpenVR wrappers, JVM flavour (deprecated)
0 stars 5 forks source link

Texture pointer #4

Open jrbudda opened 7 years ago

jrbudda commented 7 years ago

Hey thanks for doing this. phr00t's was getting behind and I couldn't get jnaerator working to save my life.

Couple questions:

Thanks!

skalarproduktraum commented 7 years ago

Hi @jrbudda!

Thanks for your input and that you find the update helpful! To answer your questions:

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!

jrbudda commented 7 years ago

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.

jrbudda commented 7 years ago

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.

skalarproduktraum commented 7 years ago

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 :-\

jrbudda commented 7 years ago

yup. interesting.