Browse Source

Using GLfloat as default template parameter also in Color.

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
5b707d3524
  1. 2
      src/AbstractTexture.h
  2. 14
      src/Color.h
  3. 2
      src/CubeMapTexture.h
  4. 2
      src/CubeMapTextureArray.h
  5. 4
      src/Framebuffer.h
  6. 4
      src/Magnum.h
  7. 2
      src/Mesh.h
  8. 4
      src/Physics/DebugDrawResourceManager.h
  9. 2
      src/Shaders/FlatShader.h
  10. 8
      src/Shaders/PhongShader.h
  11. 2
      src/Shaders/VertexColorShader.h
  12. 2
      src/Texture.h

2
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<GLfloat>& color) {
inline AbstractTexture* setBorderColor(const Color4<>& color) {
(this->*parameterfvImplementation)(GL_TEXTURE_BORDER_COLOR, color.data());
return this;
}

14
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 T> class Color3: public Math::Vector3<T> {
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class T>
#else
template<class T = GLfloat>
#endif
class Color3: public Math::Vector3<T> {
public:
/** @brief Corresponding floating-point type for HSV computation */
typedef typename Math::MathTypeTraits<T>::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 T> class Color4: public Math::Vector4<T> {
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class T>
#else
template<class T = GLfloat>
#endif
class Color4: public Math::Vector4<T> {
public:
/** @copydoc Color3::FloatingPointType */
typedef typename Color3<T>::FloatingPointType FloatingPointType;

2
src/CubeMapTexture.h

@ -121,7 +121,7 @@ class CubeMapTexture: public AbstractTexture {
return this;
}
#ifndef MAGNUM_TARGET_GLES
inline CubeMapTexture* setBorderColor(const Color4<GLfloat>& color) {
inline CubeMapTexture* setBorderColor(const Color4<>& color) {
AbstractTexture::setBorderColor(color);
return this;
}

2
src/CubeMapTextureArray.h

@ -133,7 +133,7 @@ class CubeMapTextureArray: public AbstractTexture {
AbstractTexture::setMagnificationFilter(filter);
return this;
}
inline CubeMapTextureArray* setBorderColor(const Color4<GLfloat>& color) {
inline CubeMapTextureArray* setBorderColor(const Color4<>& color) {
AbstractTexture::setBorderColor(color);
return this;
}

4
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<GLfloat>& 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<GLfloat>& color) {
inline static void setBlendColor(const Color4<>& color) {
glBlendColor(color.r(), color.g(), color.b(), color.a());
}

4
src/Magnum.h

@ -113,8 +113,8 @@ typedef BufferedImage<3> BufferedImage3D;
class BufferedTexture;
#endif
template<class> class Color3;
template<class> class Color4;
template<class = GLfloat> class Color3;
template<class = GLfloat> class Color4;
enum class Version: GLint;
class Context;

2
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<GLfloat>> Color;
typedef Attribute<1, Color4<>> Color;
// ...
};

4
src/Physics/DebugDrawResourceManager.h

@ -37,7 +37,7 @@ namespace Magnum {
#ifndef DOXYGEN_GENERATING_OUTPUT
namespace Physics { namespace Implementation {
struct Options {
Color3<GLfloat> color;
Color3<> color;
};
template<std::uint8_t> class DebugRenderer;
}}
@ -86,7 +86,7 @@ class PHYSICS_EXPORT DebugDrawResourceManager: public ResourceManager<AbstractSh
#ifdef DOXYGEN_GENERATING_OUTPUT
/** @brief %Options */
struct Options {
Color3<GLfloat> color; /**< @brief Color */
Color3<> color; /**< @brief Color */
};
#else
typedef Implementation::Options Options;

2
src/Shaders/FlatShader.h

@ -55,7 +55,7 @@ template<std::uint8_t dimensions> class SHADERS_EXPORT FlatShader: public Abstra
* @brief Set color
* @return Pointer to self (for method chaining)
*/
FlatShader<dimensions>* setColor(const Color3<GLfloat>& color) {
FlatShader<dimensions>* setColor(const Color3<>& color) {
setUniform(colorUniform, color);
return this;
}

8
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<GLfloat>& 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<GLfloat>& 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<GLfloat>& 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<GLfloat>& color) {
inline PhongShader* setLightColor(const Color3<>& color) {
setUniform(lightColorUniform, color);
return this;
}

2
src/Shaders/VertexColorShader.h

@ -41,7 +41,7 @@ template<std::uint8_t dimensions> class SHADERS_EXPORT VertexColorShader: public
typedef Attribute<0, typename DimensionTraits<dimensions>::PointType> Position;
/** @brief Vertex color */
typedef Attribute<1, Color3<GLfloat>> Color;
typedef Attribute<1, Color3<>> Color;
VertexColorShader();

2
src/Texture.h

@ -203,7 +203,7 @@ template<std::uint8_t dimensions> class Texture: public AbstractTexture {
return this;
}
#ifndef MAGNUM_TARGET_GLES
inline Texture<Dimensions>* setBorderColor(const Color4<GLfloat>& color) {
inline Texture<Dimensions>* setBorderColor(const Color4<>& color) {
AbstractTexture::setBorderColor(color);
return this;
}

Loading…
Cancel
Save