Browse Source

Move FlatGL impls from header

pull/576/head
Vladislav Oleshko 4 years ago
parent
commit
1d6c99da76
  1. 13
      src/Magnum/Shaders/FlatGL.cpp
  2. 11
      src/Magnum/Shaders/FlatGL.h

13
src/Magnum/Shaders/FlatGL.cpp

@ -312,6 +312,19 @@ template<UnsignedInt dimensions> FlatGL<dimensions>::FlatGL(CompileState&& cs)
static_cast<void>(context); static_cast<void>(context);
} }
template<UnsignedInt dimensions> FlatGL<dimensions>::FlatGL(Flags flags) : FlatGL{compile(flags)} {}
#ifndef MAGNUM_TARGET_GLES2
template<UnsignedInt dimensions> typename FlatGL<dimensions>::CompileState FlatGL<dimensions>::compile(Flags flags) {
return compile(flags, 1, 1);
}
template<UnsignedInt dimensions> FlatGL<dimensions>::FlatGL(Flags flags, UnsignedInt materialCount, UnsignedInt drawCount)
: FlatGL{compile(flags, materialCount, drawCount)} {}
#endif
template<UnsignedInt dimensions> FlatGL<dimensions>::FlatGL(NoInitT) {}
template<UnsignedInt dimensions> FlatGL<dimensions>& FlatGL<dimensions>::setTransformationProjectionMatrix(const MatrixTypeFor<dimensions, Float>& matrix) { template<UnsignedInt dimensions> FlatGL<dimensions>& FlatGL<dimensions>::setTransformationProjectionMatrix(const MatrixTypeFor<dimensions, Float>& matrix) {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers), CORRADE_ASSERT(!(_flags >= Flag::UniformBuffers),

11
src/Magnum/Shaders/FlatGL.h

@ -550,7 +550,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
* @ref FlatGL(Flags, UnsignedInt, UnsignedInt) with @p materialCount * @ref FlatGL(Flags, UnsignedInt, UnsignedInt) with @p materialCount
* and @p drawCount set to @cpp 1 @ce. * and @p drawCount set to @cpp 1 @ce.
*/ */
explicit FlatGL(Flags flags = {}) : FlatGL{compile(flags)} {} explicit FlatGL(Flags flags = {});
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
/** /**
@ -586,8 +586,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
for this might be too confusing); what if some parameters won't be for this might be too confusing); what if some parameters won't be
(unsigned) integers? like a string with shader extensions? make a (unsigned) integers? like a string with shader extensions? make a
whole Configuration class? */ whole Configuration class? */
explicit FlatGL(Flags flags, UnsignedInt materialCount, UnsignedInt drawCount): explicit FlatGL(Flags flags, UnsignedInt materialCount, UnsignedInt drawCount);
FlatGL{compile(flags, materialCount, drawCount)} {}
#endif #endif
/** /**
@ -615,9 +614,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
); );
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
static CompileState compile(Flags flags) { static CompileState compile(Flags flags);
return compile(flags, 1, 1);
}
#endif #endif
/** @brief Copying is not allowed */ /** @brief Copying is not allowed */
@ -1030,7 +1027,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL: public GL::
private: private:
/* Creates the GL shader program object but nothing else. Internal, used by compile(). */ /* Creates the GL shader program object but nothing else. Internal, used by compile(). */
explicit FlatGL(NoInitT) {} explicit FlatGL(NoInitT);
/* Prevent accidentally calling irrelevant functions */ /* Prevent accidentally calling irrelevant functions */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

Loading…
Cancel
Save