Hello Guest

[CLOSED] No glMultiDrawElements?

  • 2 Replies
  • 3395 Views
*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
[CLOSED] No glMultiDrawElements?
« 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
« Last Edit: October 31, 2013, 16:41:57 by kappa »

*

Offline spasi

  • *****
  • 2163
    • WebHotelier
Re: No glMultiDrawElements?
« Reply #1 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 (Java) and here (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.

*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
Re: No glMultiDrawElements?
« Reply #2 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.