diff --git a/src/Magnum/GL/Implementation/MeshState.cpp b/src/Magnum/GL/Implementation/MeshState.cpp index eeed2fe08..eef00a734 100644 --- a/src/Magnum/GL/Implementation/MeshState.cpp +++ b/src/Magnum/GL/Implementation/MeshState.cpp @@ -159,8 +159,8 @@ MeshState::MeshState(Context& context, ContextState& contextState, std::vector()) { extensions.push_back(Extensions::ANGLE::instanced_arrays::string()); - drawArraysInstancedImplementation = &Mesh::drawArraysInstancedImplementationANGLE; - drawElementsInstancedImplementation = &Mesh::drawElementsInstancedImplementationANGLE; + drawArraysInstancedImplementation = glDrawArraysInstancedANGLE; + drawElementsInstancedImplementation = glDrawElementsInstancedANGLE; } #ifndef MAGNUM_TARGET_WEBGL else if(context.isExtensionSupported() || @@ -169,8 +169,8 @@ MeshState::MeshState(Context& context, ContextState& contextState, std::vector() || context.isExtensionSupported()) { @@ -178,8 +178,8 @@ MeshState::MeshState(Context& context, ContextState& contextState, std::vector*state.drawArraysInstancedImplementation)(baseVertex, count, instanceCount); + state.drawArraysInstancedImplementation #endif + (GLenum(_primitive), baseVertex, count, instanceCount); } /* Indexed mesh with base vertex */ @@ -503,10 +504,11 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i #endif { #ifndef MAGNUM_TARGET_GLES2 - glDrawElementsInstanced(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast(indexOffset), instanceCount); + glDrawElementsInstanced #else - (this->*state.drawElementsInstancedImplementation)(count, indexOffset, instanceCount); + state.drawElementsInstancedImplementation #endif + (GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast(indexOffset), instanceCount); } } } @@ -871,34 +873,4 @@ void Mesh::unbindImplementationDefault() { void Mesh::unbindImplementationVAO() {} -#ifdef MAGNUM_TARGET_GLES2 -void Mesh::drawArraysInstancedImplementationANGLE(const GLint baseVertex, const GLsizei count, const GLsizei instanceCount) { - glDrawArraysInstancedANGLE(GLenum(_primitive), baseVertex, count, instanceCount); -} - -#ifndef MAGNUM_TARGET_WEBGL -void Mesh::drawArraysInstancedImplementationEXT(const GLint baseVertex, const GLsizei count, const GLsizei instanceCount) { - glDrawArraysInstancedEXT(GLenum(_primitive), baseVertex, count, instanceCount); -} - -void Mesh::drawArraysInstancedImplementationNV(const GLint baseVertex, const GLsizei count, const GLsizei instanceCount) { - glDrawArraysInstancedNV(GLenum(_primitive), baseVertex, count, instanceCount); -} -#endif - -void Mesh::drawElementsInstancedImplementationANGLE(const GLsizei count, const GLintptr indexOffset, const GLsizei instanceCount) { - glDrawElementsInstancedANGLE(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast(indexOffset), instanceCount); -} - -#ifndef MAGNUM_TARGET_WEBGL -void Mesh::drawElementsInstancedImplementationEXT(const GLsizei count, const GLintptr indexOffset, const GLsizei instanceCount) { - glDrawElementsInstancedEXT(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast(indexOffset), instanceCount); -} - -void Mesh::drawElementsInstancedImplementationNV(const GLsizei count, const GLintptr indexOffset, const GLsizei instanceCount) { - glDrawElementsInstancedNV(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast(indexOffset), instanceCount); -} -#endif -#endif - }} diff --git a/src/Magnum/GL/Mesh.h b/src/Magnum/GL/Mesh.h index ad78ce5f5..a2c25d402 100644 --- a/src/Magnum/GL/Mesh.h +++ b/src/Magnum/GL/Mesh.h @@ -1133,20 +1133,6 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { void MAGNUM_GL_LOCAL unbindImplementationDefault(); void MAGNUM_GL_LOCAL unbindImplementationVAO(); - #ifdef MAGNUM_TARGET_GLES2 - void MAGNUM_GL_LOCAL drawArraysInstancedImplementationANGLE(GLint baseVertex, GLsizei count, GLsizei instanceCount); - #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_GL_LOCAL drawArraysInstancedImplementationEXT(GLint baseVertex, GLsizei count, GLsizei instanceCount); - void MAGNUM_GL_LOCAL drawArraysInstancedImplementationNV(GLint baseVertex, GLsizei count, GLsizei instanceCount); - #endif - - void MAGNUM_GL_LOCAL drawElementsInstancedImplementationANGLE(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); - #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_GL_LOCAL drawElementsInstancedImplementationEXT(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); - void MAGNUM_GL_LOCAL drawElementsInstancedImplementationNV(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); - #endif - #endif - /* _id, _primitive, _flags set from constructors */ GLuint _id; MeshPrimitive _primitive;