Exemple #1
0
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);
}
Exemple #2
0
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);
}
Exemple #3
0
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);
	}
}