void VertexBuffer::DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount) { ProgramObject *p = rc->GetCurProgram(); if (p) p->updateMatrices(); Bind(); glDrawArraysInstanced(mode, first, count, instanceCount); }
void VertexBuffer::DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLsizei instanceCount, int offset) { ProgramObject *p = rc->GetCurProgram(); if (p) p->updateMatrices(); Bind(); glDrawElementsInstanced(mode, count, type, (void *)offset, instanceCount); }
void VertexBuffer::DrawElements(GLenum mode, GLsizei count, GLenum type, int offset) { ProgramObject *p = rc->GetCurProgram(); if (p) p->updateMatrices(); if (GLEW_ARB_vertex_buffer_object) { Bind(); glDrawElements(mode, count, type, (void *)offset); } else { glDrawElements(mode, count, type, ptr->data + offset); } }