From 003e524a26d625bbfdcdced17209d68314eb85e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Feb 2013 22:54:51 +0100 Subject: [PATCH] Shaders: using new type aliases in whole Shaders namespace. --- src/Shaders/AbstractTextShader.h | 4 ++-- src/Shaders/FlatShader.cpp | 4 ++-- src/Shaders/FlatShader.h | 4 ++-- src/Shaders/PhongShader.h | 4 ++-- src/Shaders/Shaders.h | 10 +++++----- src/Shaders/TextShader.cpp | 4 ++-- src/Shaders/TextShader.h | 4 ++-- src/Shaders/VertexColorShader.cpp | 4 ++-- src/Shaders/VertexColorShader.h | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Shaders/AbstractTextShader.h b/src/Shaders/AbstractTextShader.h index 8f391c1f5..e1fe529af 100644 --- a/src/Shaders/AbstractTextShader.h +++ b/src/Shaders/AbstractTextShader.h @@ -30,7 +30,7 @@ namespace Magnum { namespace Shaders { @see AbstractTextShader2D, AbstractTextShader3D */ -template class AbstractTextShader: public AbstractShaderProgram { +template class AbstractTextShader: public AbstractShaderProgram { public: /** @brief Vertex position */ typedef Attribute<0, typename DimensionTraits::VectorType> Position; @@ -45,7 +45,7 @@ template class AbstractTextShader: public AbstractShade ~AbstractTextShader() = 0; }; -template inline AbstractTextShader::~AbstractTextShader() {} +template inline AbstractTextShader::~AbstractTextShader() {} /** @brief Base for two-dimensional text shaders */ typedef AbstractTextShader<2> AbstractTextShader2D; diff --git a/src/Shaders/FlatShader.cpp b/src/Shaders/FlatShader.cpp index 70b32361f..d8ea1b039 100644 --- a/src/Shaders/FlatShader.cpp +++ b/src/Shaders/FlatShader.cpp @@ -23,12 +23,12 @@ namespace Magnum { namespace Shaders { namespace { - template constexpr const char* vertexShaderName(); + template constexpr const char* vertexShaderName(); template<> constexpr const char* vertexShaderName<2>() { return "FlatShader2D.vert"; } template<> constexpr const char* vertexShaderName<3>() { return "FlatShader3D.vert"; } } -template FlatShader::FlatShader(): transformationProjectionMatrixUniform(0), colorUniform(1) { +template FlatShader::FlatShader(): transformationProjectionMatrixUniform(0), colorUniform(1) { Corrade::Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES diff --git a/src/Shaders/FlatShader.h b/src/Shaders/FlatShader.h index 6eb110a3c..ea0922816 100644 --- a/src/Shaders/FlatShader.h +++ b/src/Shaders/FlatShader.h @@ -35,7 +35,7 @@ namespace Magnum { namespace Shaders { Draws whole mesh with one color. @see FlatShader2D, FlatShader3D */ -template class MAGNUM_SHADERS_EXPORT FlatShader: public AbstractShaderProgram { +template class MAGNUM_SHADERS_EXPORT FlatShader: public AbstractShaderProgram { public: /** @brief Vertex position */ typedef Attribute<0, typename DimensionTraits::VectorType> Position; @@ -61,7 +61,7 @@ template class MAGNUM_SHADERS_EXPORT FlatShader: public } private: - GLint transformationProjectionMatrixUniform, + Int transformationProjectionMatrixUniform, colorUniform; }; diff --git a/src/Shaders/PhongShader.h b/src/Shaders/PhongShader.h index a82f4c93b..3e7f84bc3 100644 --- a/src/Shaders/PhongShader.h +++ b/src/Shaders/PhongShader.h @@ -78,7 +78,7 @@ class MAGNUM_SHADERS_EXPORT PhongShader: public AbstractShaderProgram { * The larger value, the harder surface (smaller specular highlight). * If not set, default value is `80.0f`. */ - inline PhongShader* setShininess(GLfloat shininess) { + inline PhongShader* setShininess(Float shininess) { setUniform(shininessUniform, shininess); return this; } @@ -123,7 +123,7 @@ class MAGNUM_SHADERS_EXPORT PhongShader: public AbstractShaderProgram { } private: - GLint transformationMatrixUniform, + Int transformationMatrixUniform, projectionMatrixUniform, normalMatrixUniform, lightUniform, diff --git a/src/Shaders/Shaders.h b/src/Shaders/Shaders.h index fba4ef929..b4733ffd5 100644 --- a/src/Shaders/Shaders.h +++ b/src/Shaders/Shaders.h @@ -19,27 +19,27 @@ * @brief Forward declarations for Magnum::Shaders namespace */ -#include +#include "Types.h" namespace Magnum { namespace Shaders { /** @todoc remove when doxygen is sane again */ #ifndef DOXYGEN_GENERATING_OUTPUT -template class AbstractTextShader; +template class AbstractTextShader; typedef AbstractTextShader<2> AbstractTextShader2D; typedef AbstractTextShader<3> AbstractTextShader3D; -template class FlatShader; +template class FlatShader; typedef FlatShader<2> FlatShader2D; typedef FlatShader<3> FlatShader3D; class PhongShader; -template class TextShader; +template class TextShader; typedef TextShader<2> TextShader2D; typedef TextShader<3> TextShader3D; -template class VertexColorShader; +template class VertexColorShader; typedef VertexColorShader<2> VertexColorShader2D; typedef VertexColorShader<3> VertexColorShader3D; #endif diff --git a/src/Shaders/TextShader.cpp b/src/Shaders/TextShader.cpp index e1265e784..37519d7ae 100644 --- a/src/Shaders/TextShader.cpp +++ b/src/Shaders/TextShader.cpp @@ -24,12 +24,12 @@ namespace Magnum { namespace Shaders { namespace { - template constexpr const char* vertexShaderName(); + template constexpr const char* vertexShaderName(); template<> constexpr const char* vertexShaderName<2>() { return "TextShader2D.vert"; } template<> constexpr const char* vertexShaderName<3>() { return "TextShader3D.vert"; } } -template TextShader::TextShader(): transformationProjectionMatrixUniform(0), colorUniform(1) { +template TextShader::TextShader(): transformationProjectionMatrixUniform(0), colorUniform(1) { Corrade::Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES diff --git a/src/Shaders/TextShader.h b/src/Shaders/TextShader.h index 4b1819dbb..564581506 100644 --- a/src/Shaders/TextShader.h +++ b/src/Shaders/TextShader.h @@ -32,7 +32,7 @@ namespace Magnum { namespace Shaders { @see TextShader2D, TextShader3D */ -template class MAGNUM_SHADERS_EXPORT TextShader: public AbstractTextShader { +template class MAGNUM_SHADERS_EXPORT TextShader: public AbstractTextShader { public: TextShader(); @@ -49,7 +49,7 @@ template class MAGNUM_SHADERS_EXPORT TextShader: public } private: - GLint transformationProjectionMatrixUniform, + Int transformationProjectionMatrixUniform, colorUniform; }; diff --git a/src/Shaders/VertexColorShader.cpp b/src/Shaders/VertexColorShader.cpp index e872a9fba..e73c2335e 100644 --- a/src/Shaders/VertexColorShader.cpp +++ b/src/Shaders/VertexColorShader.cpp @@ -23,12 +23,12 @@ namespace Magnum { namespace Shaders { namespace { - template constexpr const char* vertexShaderName(); + template constexpr const char* vertexShaderName(); template<> constexpr const char* vertexShaderName<2>() { return "VertexColorShader2D.vert"; } template<> constexpr const char* vertexShaderName<3>() { return "VertexColorShader3D.vert"; } } -template VertexColorShader::VertexColorShader(): transformationProjectionMatrixUniform(0) { +template VertexColorShader::VertexColorShader(): transformationProjectionMatrixUniform(0) { Corrade::Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES diff --git a/src/Shaders/VertexColorShader.h b/src/Shaders/VertexColorShader.h index 4f0275d3f..6e97d4fe5 100644 --- a/src/Shaders/VertexColorShader.h +++ b/src/Shaders/VertexColorShader.h @@ -35,7 +35,7 @@ namespace Magnum { namespace Shaders { Draws vertex-colored mesh. @see VertexColorShader2D, VertexColorShader3D */ -template class MAGNUM_SHADERS_EXPORT VertexColorShader: public AbstractShaderProgram { +template class MAGNUM_SHADERS_EXPORT VertexColorShader: public AbstractShaderProgram { public: /** @brief Vertex position */ typedef Attribute<0, typename DimensionTraits::VectorType> Position; @@ -55,7 +55,7 @@ template class MAGNUM_SHADERS_EXPORT VertexColorShader: } private: - GLint transformationProjectionMatrixUniform; + Int transformationProjectionMatrixUniform; }; /** @brief 2D vertex color shader */