From b5da1e2abc82a2ee64d508134c19a3d1ea44df00 Mon Sep 17 00:00:00 2001 From: Vladislav Oleshko Date: Tue, 23 Aug 2022 15:24:21 +0300 Subject: [PATCH] Move VertexColorGL impls from header --- src/Magnum/Shaders/VertexColorGL.cpp | 14 ++++++++++++++ src/Magnum/Shaders/VertexColorGL.h | 11 ++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Shaders/VertexColorGL.cpp b/src/Magnum/Shaders/VertexColorGL.cpp index 70c502fac..15ebb2353 100644 --- a/src/Magnum/Shaders/VertexColorGL.cpp +++ b/src/Magnum/Shaders/VertexColorGL.cpp @@ -193,6 +193,20 @@ template VertexColorGL::VertexColorGL(Compil static_cast(version); } +template VertexColorGL::VertexColorGL(Flags flags): VertexColorGL{compile(flags)} {} + +#ifndef MAGNUM_TARGET_GLES2 +template typename VertexColorGL::CompileState VertexColorGL::compile(Flags flags) { + return compile(flags, 1); +} + +template VertexColorGL::VertexColorGL(Flags flags, UnsignedInt drawCount) + : VertexColorGL{compile(flags, drawCount)} {} +#endif + +template VertexColorGL::VertexColorGL(NoInitT) {} + + template VertexColorGL& VertexColorGL::setTransformationProjectionMatrix(const MatrixTypeFor& matrix) { #ifndef MAGNUM_TARGET_GLES2 CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers), diff --git a/src/Magnum/Shaders/VertexColorGL.h b/src/Magnum/Shaders/VertexColorGL.h index 69ad1e87a..e674f05a1 100644 --- a/src/Magnum/Shaders/VertexColorGL.h +++ b/src/Magnum/Shaders/VertexColorGL.h @@ -217,7 +217,7 @@ template class MAGNUM_SHADERS_EXPORT VertexColorGL: publ * @ref VertexColorGL(Flags, UnsignedInt) with @p drawCount set to * @cpp 1 @ce. */ - explicit VertexColorGL(Flags flags = {}): VertexColorGL{compile(flags)} {} + explicit VertexColorGL(Flags flags = {}); #ifndef MAGNUM_TARGET_GLES2 /** @@ -248,8 +248,7 @@ template class MAGNUM_SHADERS_EXPORT VertexColorGL: publ 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 VertexColorGL(Flags flags, UnsignedInt drawCount): - VertexColorGL{compile(flags, drawCount)} {} + explicit VertexColorGL(Flags flags, UnsignedInt drawCount); #endif /** @@ -277,9 +276,7 @@ template class MAGNUM_SHADERS_EXPORT VertexColorGL: publ ); #ifndef MAGNUM_TARGET_GLES2 - static CompileState compile(Flags flags) { - return compile(flags, 1); - } + static CompileState compile(Flags flags); #endif /** @brief Copying is not allowed */ @@ -424,7 +421,7 @@ template class MAGNUM_SHADERS_EXPORT VertexColorGL: publ #endif private: - explicit VertexColorGL(NoInitT) {} + explicit VertexColorGL(NoInitT); /* Prevent accidentally calling irrelevant functions */ #ifndef MAGNUM_TARGET_GLES