diff --git a/src/Magnum/Shaders/VectorGL.cpp b/src/Magnum/Shaders/VectorGL.cpp index 16d1e7040..c443cf714 100644 --- a/src/Magnum/Shaders/VectorGL.cpp +++ b/src/Magnum/Shaders/VectorGL.cpp @@ -230,6 +230,20 @@ template VectorGL::VectorGL(CompileState&& c static_cast(version); } +template VectorGL::VectorGL(Flags flags) : VectorGL{compile(flags)} {} + +#ifndef MAGNUM_TARGET_GLES2 +template typename VectorGL::CompileState VectorGL::compile(Flags flags) { + return compile(flags, 1, 1); +} + +template VectorGL::VectorGL(Flags flags, UnsignedInt materialCount, UnsignedInt drawCount) + : VectorGL{compile(flags, materialCount, drawCount)} {} +#endif + +template VectorGL::VectorGL(NoInitT) {} + + template VectorGL& VectorGL::setTransformationProjectionMatrix(const MatrixTypeFor& matrix) { #ifndef MAGNUM_TARGET_GLES2 CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers), diff --git a/src/Magnum/Shaders/VectorGL.h b/src/Magnum/Shaders/VectorGL.h index ae4a3aa6c..232a076d2 100644 --- a/src/Magnum/Shaders/VectorGL.h +++ b/src/Magnum/Shaders/VectorGL.h @@ -222,7 +222,7 @@ template class MAGNUM_SHADERS_EXPORT VectorGL: public GL * @ref VectorGL(Flags, UnsignedInt, UnsignedInt) with @p materialCount * and @p drawCount set to @cpp 1 @ce. */ - explicit VectorGL(Flags flags = {}) : VectorGL{compile(flags)} {}; + explicit VectorGL(Flags flags = {}); #ifndef MAGNUM_TARGET_GLES2 /** @@ -257,8 +257,7 @@ template class MAGNUM_SHADERS_EXPORT VectorGL: public GL for this might be too confusing); what if some parameters won't be (unsigned) integers? like a string with shader extensions? make a whole Configuration class? */ - explicit VectorGL(Flags flags, UnsignedInt materialCount, UnsignedInt drawCount) : - VectorGL{compile(flags, materialCount, drawCount)} {} + explicit VectorGL(Flags flags, UnsignedInt materialCount, UnsignedInt drawCount); #endif /** @@ -286,9 +285,7 @@ template class MAGNUM_SHADERS_EXPORT VectorGL: public GL ); #ifndef MAGNUM_TARGET_GLES2 - static CompileState compile(Flags flags) { - return compile(flags, 1, 1); - } + static CompileState compile(Flags flags); #endif /** @brief Copying is not allowed */ @@ -573,7 +570,7 @@ template class MAGNUM_SHADERS_EXPORT VectorGL: public GL private: /* Creates the GL shader program object but nothing else. Internal, used by compile(). */ - explicit VectorGL(NoInitT) {} + explicit VectorGL(NoInitT); /* Prevent accidentally calling irrelevant functions */ #ifndef MAGNUM_TARGET_GLES