LWJGL3 pointer buffer structures

Started by Efi, June 18, 2019, 17:52:13

Previous topic - Next topic

Efi

I think I am missing something, I've been looking at the docs and I don't quite get how to use the pointer buffers.
The Assimp library provides the imported data as class structures that contain some pointer buffers, but I can't figure out how to retrieve the objects those pointers represent.
For example, in the aiScene there's the mMeshes method which returns a pointer buffer
But that's just a Long, what do I do with that number??? how do I get the actual aiMesh instance?

KaiHH

Have a look at the LWJGL/lwjgl3-demos Assimp demo here: https://github.com/LWJGL/lwjgl3-demos/blob/master/src/org/lwjgl/demo/opengl/assimp/WavefrontObjDemo.java#L384-L389
You basically call <Struct>.create(pointerValue/long) to construct a struct instance from a pointer/long value.

Efi

I thought the object would already be created.
I missed the part where it's a static call... oooooops >____<
ok, all good, thanks <3

ps: btw, loading blender files from clojure is possible, so nice