From 5b707d35248efbd75ee4a3b2cd45e1a6042bbd9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 22 Nov 2012 00:53:33 +0100 Subject: [PATCH] Using GLfloat as default template parameter also in Color. --- src/AbstractTexture.h | 2 +- src/Color.h | 14 ++++++++++++-- src/CubeMapTexture.h | 2 +- src/CubeMapTextureArray.h | 2 +- src/Framebuffer.h | 4 ++-- src/Magnum.h | 4 ++-- src/Mesh.h | 2 +- src/Physics/DebugDrawResourceManager.h | 4 ++-- src/Shaders/FlatShader.h | 2 +- src/Shaders/PhongShader.h | 8 ++++---- src/Shaders/VertexColorShader.h | 2 +- src/Texture.h | 2 +- 12 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index a9942dffe..ae43129c7 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -677,7 +677,7 @@ class MAGNUM_EXPORT AbstractTexture { * with @def_gl{TEXTURE_BORDER_COLOR} * @requires_gl Texture border is not available in OpenGL ES. */ - inline AbstractTexture* setBorderColor(const Color4& color) { + inline AbstractTexture* setBorderColor(const Color4<>& color) { (this->*parameterfvImplementation)(GL_TEXTURE_BORDER_COLOR, color.data()); return this; } diff --git a/src/Color.h b/src/Color.h index 36d4ad4c8..300fa549a 100644 --- a/src/Color.h +++ b/src/Color.h @@ -145,7 +145,12 @@ range @f$ [0.0, 1.0] @f$. */ /* Not using template specialization because some internal functions are impossible to explicitly instantiate */ -template class Color3: public Math::Vector3 { +#ifndef DOXYGEN_GENERATING_OUTPUT +template +#else +template +#endif +class Color3: public Math::Vector3 { public: /** @brief Corresponding floating-point type for HSV computation */ typedef typename Math::MathTypeTraits::FloatingPointType FloatingPointType; @@ -291,7 +296,12 @@ See Color3 for more information. */ /* Not using template specialization because some internal functions are impossible to explicitly instantiate */ -template class Color4: public Math::Vector4 { +#ifndef DOXYGEN_GENERATING_OUTPUT +template +#else +template +#endif +class Color4: public Math::Vector4 { public: /** @copydoc Color3::FloatingPointType */ typedef typename Color3::FloatingPointType FloatingPointType; diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index df1d3b77f..5141f0a24 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -121,7 +121,7 @@ class CubeMapTexture: public AbstractTexture { return this; } #ifndef MAGNUM_TARGET_GLES - inline CubeMapTexture* setBorderColor(const Color4& color) { + inline CubeMapTexture* setBorderColor(const Color4<>& color) { AbstractTexture::setBorderColor(color); return this; } diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index 0aa441935..fdf55ca79 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -133,7 +133,7 @@ class CubeMapTextureArray: public AbstractTexture { AbstractTexture::setMagnificationFilter(filter); return this; } - inline CubeMapTextureArray* setBorderColor(const Color4& color) { + inline CubeMapTextureArray* setBorderColor(const Color4<>& color) { AbstractTexture::setBorderColor(color); return this; } diff --git a/src/Framebuffer.h b/src/Framebuffer.h index 6099ecea1..afe0a57f1 100644 --- a/src/Framebuffer.h +++ b/src/Framebuffer.h @@ -165,7 +165,7 @@ class MAGNUM_EXPORT Framebuffer { * Initial value is `{0.0f, 0.0f, 0.0f, 1.0f}`. * @see @fn_gl{ClearColor} */ - inline static void setClearColor(const Color4& color) { + inline static void setClearColor(const Color4<>& color) { glClearColor(color.r(), color.g(), color.b(), color.a()); } @@ -631,7 +631,7 @@ class MAGNUM_EXPORT Framebuffer { * @attention You have to enable blending with setFeature() first. * @see @fn_gl{BlendColor} */ - inline static void setBlendColor(const Color4& color) { + inline static void setBlendColor(const Color4<>& color) { glBlendColor(color.r(), color.g(), color.b(), color.a()); } diff --git a/src/Magnum.h b/src/Magnum.h index 56579b81e..4701864a0 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -113,8 +113,8 @@ typedef BufferedImage<3> BufferedImage3D; class BufferedTexture; #endif -template class Color3; -template class Color4; +template class Color3; +template class Color4; enum class Version: GLint; class Context; diff --git a/src/Mesh.h b/src/Mesh.h index d90687956..21930fad8 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -83,7 +83,7 @@ component ordering (e.g. directly from @ref Trade::TgaImporter "TGA file"): @code class MyShader: public AbstractShaderProgram { public: - typedef Attribute<1, Color4> Color; + typedef Attribute<1, Color4<>> Color; // ... }; diff --git a/src/Physics/DebugDrawResourceManager.h b/src/Physics/DebugDrawResourceManager.h index 041e77134..d7a2fff44 100644 --- a/src/Physics/DebugDrawResourceManager.h +++ b/src/Physics/DebugDrawResourceManager.h @@ -37,7 +37,7 @@ namespace Magnum { #ifndef DOXYGEN_GENERATING_OUTPUT namespace Physics { namespace Implementation { struct Options { - Color3 color; + Color3<> color; }; template class DebugRenderer; }} @@ -86,7 +86,7 @@ class PHYSICS_EXPORT DebugDrawResourceManager: public ResourceManager color; /**< @brief Color */ + Color3<> color; /**< @brief Color */ }; #else typedef Implementation::Options Options; diff --git a/src/Shaders/FlatShader.h b/src/Shaders/FlatShader.h index af839d760..68ff70231 100644 --- a/src/Shaders/FlatShader.h +++ b/src/Shaders/FlatShader.h @@ -55,7 +55,7 @@ template class SHADERS_EXPORT FlatShader: public Abstra * @brief Set color * @return Pointer to self (for method chaining) */ - FlatShader* setColor(const Color3& color) { + FlatShader* setColor(const Color3<>& color) { setUniform(colorUniform, color); return this; } diff --git a/src/Shaders/PhongShader.h b/src/Shaders/PhongShader.h index efccc6f88..9ec97be53 100644 --- a/src/Shaders/PhongShader.h +++ b/src/Shaders/PhongShader.h @@ -46,7 +46,7 @@ class SHADERS_EXPORT PhongShader: public AbstractShaderProgram { * * If not set, default value is `(0.0f, 0.0f, 0.0f)`. */ - inline PhongShader* setAmbientColor(const Color3& color) { + inline PhongShader* setAmbientColor(const Color3<>& color) { setUniform(ambientColorUniform, color); return this; } @@ -55,7 +55,7 @@ class SHADERS_EXPORT PhongShader: public AbstractShaderProgram { * @brief Set diffuse color * @return Pointer to self (for method chaining) */ - inline PhongShader* setDiffuseColor(const Color3& color) { + inline PhongShader* setDiffuseColor(const Color3<>& color) { setUniform(diffuseColorUniform, color); return this; } @@ -66,7 +66,7 @@ class SHADERS_EXPORT PhongShader: public AbstractShaderProgram { * * If not set, default value is `(1.0f, 1.0f, 1.0f)`. */ - inline PhongShader* setSpecularColor(const Color3& color) { + inline PhongShader* setSpecularColor(const Color3<>& color) { setUniform(specularColorUniform, color); return this; } @@ -117,7 +117,7 @@ class SHADERS_EXPORT PhongShader: public AbstractShaderProgram { * * If not set, default value is `(1.0f, 1.0f, 1.0f)`. */ - inline PhongShader* setLightColor(const Color3& color) { + inline PhongShader* setLightColor(const Color3<>& color) { setUniform(lightColorUniform, color); return this; } diff --git a/src/Shaders/VertexColorShader.h b/src/Shaders/VertexColorShader.h index 437e1a7ed..fbed9f38a 100644 --- a/src/Shaders/VertexColorShader.h +++ b/src/Shaders/VertexColorShader.h @@ -41,7 +41,7 @@ template class SHADERS_EXPORT VertexColorShader: public typedef Attribute<0, typename DimensionTraits::PointType> Position; /** @brief Vertex color */ - typedef Attribute<1, Color3> Color; + typedef Attribute<1, Color3<>> Color; VertexColorShader(); diff --git a/src/Texture.h b/src/Texture.h index c73550993..91cca9459 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -203,7 +203,7 @@ template class Texture: public AbstractTexture { return this; } #ifndef MAGNUM_TARGET_GLES - inline Texture* setBorderColor(const Color4& color) { + inline Texture* setBorderColor(const Color4<>& color) { AbstractTexture::setBorderColor(color); return this; }