I am using the ARB_vertex_buffer_object on a Panther 10.3.4, but when it gets to the call of glDrawElements, I got a Access Fault error …
The problem is that the same piece of code works just fine under Win32 … but crashes under MacOSX
Here is the code I use to do so :
// First Create the vertex buffers (somewhere in a function) :
glGenBufferARB(1, &glName);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, glName);
// Somewhere fill the data into memory, then send them
// to the buffer (again another function)
glBindlBufferARB(GL_ARRAY_BUFFER_ARB, glName);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, size, pMem, GL_STATIC_ARB);
// I Create the same way the GL_ELEMENT_ARRAY_ARB buffers for indices
// Then I finally render it, binding it, then setting all pointers I want to use, and send it to GL
glBindBufferARB(GL_ARRAY_BUFFER, glName);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, glIbName);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(size, GL_FLOAT, vSize, (char *) NULL + startOffset);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, vSize, (char *) NULL + offset);
// Finally call glDrawElements to render vertex buffer
glDrawElements(primType, idxCount, GL_UNSIGNED_INT, (char *) NULL + (startIndex * (sizeof(short int)));