void HexagonMirrorApp::drawArraysInstanced( const gl::VboMesh &vbo, GLint first, GLsizei count, size_t instanceCount ) { vbo.enableClientStates(); vbo.bindAllData(); #if( defined GLEE_ARB_draw_instanced ) glDrawArraysInstancedARB( vbo.getPrimitiveType(), first, count, instanceCount ); #elif( defined GLEE_EXT_draw_instanced ) glDrawArraysInstancedEXT( vbo.getPrimitiveType(), first, count, instanceCount ); #else // fall back to rendering a single instance glDrawArrays( vbo.getPrimitiveType(), first, count ); #endif gl::VboMesh::unbindBuffers(); vbo.disableClientStates(); }
void HexagonMirrorApp::drawRangeInstanced( const gl::VboMesh &vbo, size_t startIndex, size_t indexCount, size_t instanceCount ) { if( vbo.getNumIndices() <= 0 ) return; vbo.enableClientStates(); vbo.bindAllData(); #if( defined GLEE_ARB_draw_instanced ) glDrawElementsInstancedARB( vbo.getPrimitiveType(), indexCount, GL_UNSIGNED_INT, (GLvoid*)( sizeof(uint32_t) * startIndex ), instanceCount ); #elif( defined GLEE_EXT_draw_instanced ) glDrawElementsInstancedEXT( vbo.getPrimitiveType(), indexCount, GL_UNSIGNED_INT, (GLvoid*)( sizeof(uint32_t) * startIndex ), instanceCount ); #else // fall back to rendering a single instance glDrawElements( vbo.getPrimitiveType(), indexCount, GL_UNSIGNED_INT, (GLvoid*)( sizeof(uint32_t) * startIndex ) ); #endif gl::VboMesh::unbindBuffers(); vbo.disableClientStates(); }