GLuint VertexStride;
GLuint ColorStride;
GLuint NumElements;
+ GLuint MaxElement;
};
static struct object Objects[NUM_OBJECTS];
if (obj->NumElements > 0) {
/* indexed arrays */
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, obj->ElementsBufferID);
- glDrawElements(GL_LINE_LOOP, obj->NumElements, GL_UNSIGNED_INT, NULL);
+ glDrawRangeElements(GL_LINE_LOOP, 0, obj->MaxElement,
+ obj->NumElements, GL_UNSIGNED_INT, NULL);
}
else {
/* non-indexed arrays */
obj->VertexStride = 0;
obj->ColorStride = 0;
obj->NumElements = 0;
+ obj->MaxElement = 0;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
obj->ColorStride = 6 * sizeof(GLfloat);
obj->NumElements = 0;
+ obj->MaxElement = 0;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
i[3] = 3;
glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB);
obj->NumElements = 4;
+ obj->MaxElement = 3;
if (Have_ARB_vertex_array_object) {
CreateVertexArrayObject(obj);
/* Setup a buffer of indices to test the ELEMENTS path */
obj->ElementsBufferID = 0;
obj->NumElements = 0;
+ obj->MaxElement = 0;
if (Have_ARB_vertex_array_object) {
CreateVertexArrayObject(obj);