Browse Source

Shaders: make VertexColor generic attribute.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
bab8ce0a4a
  1. 8
      src/Magnum/Shaders/Generic.h
  2. 4
      src/Magnum/Shaders/VertexColor.h

8
src/Magnum/Shaders/Generic.h

@ -66,6 +66,13 @@ template<UnsignedInt dimensions> 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 {

4
src/Magnum/Shaders/VertexColor.h

@ -93,9 +93,9 @@ template<UnsignedInt dimensions> 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<dimensions>::Color Color;
explicit VertexColor();

Loading…
Cancel
Save