All,
I am attempting to render VBOs with glMultiDrawElements() and buffering the vertex indices. My application crashes on the glMultiDrawElements() call with the following:
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x05041d2f, pid=5808, tid=3152
The following psuedo code represenets how I might set up the vertex indices to render two triangles, and illustrates where my mistake most likely exists.
FloatBuffer vertices = {0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0}
IntBuffer indices= {0, 1, 2, 3, 4, 5};
IntBuffer groupLengths = {3, 3};
int count = 2;
IntBuffer[] offsets = {{0}, {12}}; //byte offsets of primitives in indices
//more code here
glBindBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.capacity() * 4, indices, GL_STATIC_DRAW);
//more code here
glMultiDrawElements(GL_LINE_LOOP, groupLengths, GL2.GL_UNSIGNED_INT, offsets, count);
I hope this is clear enough for everyone. Please let me know if you see anything wrong with this structuring. Or if anyone can post how they rendered VBOs usings glMultiDrawElements() and buffering the indices it would be very much appreciated. From what I have found googling, this appears to be something that many others have trouble with.
Thank you,
Robert