Hello Guest

LWJGL3 pointer buffer structures

  • 2 Replies
  • 237 Views
*

Offline Efi

  • *
  • 2
LWJGL3 pointer buffer structures
« on: June 18, 2019, 17:52:13 »
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?

*

Offline KaiHH

  • ****
  • 220
Re: LWJGL3 pointer buffer structures
« Reply #1 on: June 18, 2019, 19:22:38 »
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.

*

Offline Efi

  • *
  • 2
Re: LWJGL3 pointer buffer structures
« Reply #2 on: June 18, 2019, 19:56:59 »
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
« Last Edit: June 18, 2019, 20:01:01 by Efi »