From bab8ce0a4adc2c389e7b77faee066ad57fbf560f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 2 Aug 2015 13:18:34 +0200 Subject: [PATCH] Shaders: make VertexColor generic attribute. --- src/Magnum/Shaders/Generic.h | 8 ++++++++ src/Magnum/Shaders/VertexColor.h | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Shaders/Generic.h b/src/Magnum/Shaders/Generic.h index 267465ed3..185f61a5b 100644 --- a/src/Magnum/Shaders/Generic.h +++ b/src/Magnum/Shaders/Generic.h @@ -66,6 +66,13 @@ template struct Generic { * @ref Vector3, defined only in 3D. */ typedef Attribute<2, Vector3> Normal; + + /** + * @brief Vertex color + * + * @ref Color3. + */ + typedef Attribute<3, Color3> Color; }; #endif @@ -78,6 +85,7 @@ typedef Generic<3> Generic3D; #ifndef DOXYGEN_GENERATING_OUTPUT struct BaseGeneric { typedef Attribute<1, Vector2> TextureCoordinates; + typedef Attribute<3, Color3> Color; }; template<> struct Generic<2>: BaseGeneric { diff --git a/src/Magnum/Shaders/VertexColor.h b/src/Magnum/Shaders/VertexColor.h index a31076958..3f98b61dc 100644 --- a/src/Magnum/Shaders/VertexColor.h +++ b/src/Magnum/Shaders/VertexColor.h @@ -93,9 +93,9 @@ template class MAGNUM_SHADERS_EXPORT VertexColor: public /** * @brief Vertex color * - * @ref shaders-generic "Generic attribute", @ref Vector3. + * @ref shaders-generic "Generic attribute", @ref Color3. */ - typedef Attribute<3, Color3> Color; + typedef typename Generic::Color Color; explicit VertexColor();