LWJGL Forum

Archive => Resolved Bugs/RFE => Topic started by: quew8 on May 04, 2013, 20:20:11

Title: [CLOSED] No glMultiDrawElements?
Post by: quew8 on May 04, 2013, 20:20:11
I have been unable to find this method in any of the GLXX classes - pretty sure it should be in GL14.
http://www.opengl.org/sdk/docs/man2/xhtml/glMultiDrawElements.xml (http://www.opengl.org/sdk/docs/man2/xhtml/glMultiDrawElements.xml)
Title: Re: No glMultiDrawElements?
Post by: spasi on May 05, 2013, 06:03:45
The reason is that it's quite awkward to call a function that accepts a pointer-to-pointers from Java. It'd have to be mapped to an array at the Java side and the generator would have to emit lots of code at the C side to make it work properly. A lot of complexity for little gain compared to a DrawElements loop.

With that said, LWJGL 3.0 has support for it, but in the lightest possible way. You can see the code here (https://github.com/LWJGL/lwjgl3-generated/blob/master/java/org/lwjgl/opengl/GL14.java) (Java) and here (https://github.com/LWJGL/lwjgl3-generated/blob/master/native/opengl/org_lwjgl_opengl_GL14.c) (C). The user is responsible for building the pointer array, which is mapped to a PointerBuffer. This is the theme in 3.0 in general; all JNI functions are very slim, only casts + native calls.
Title: Re: No glMultiDrawElements?
Post by: quew8 on May 05, 2013, 09:37:51
Ok, I understand. I thought it might be something like that except for there being a glMultDrawArrays but now I see that's different.
Also, the more I hear about 3.0 ... Great work as ever, you seem to have solved every problem before I even know it's there.