Browse Source

Shaders: removed redundant `inline` keyword.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
4f82053058
  1. 10
      src/Shaders/DistanceFieldVector.h
  2. 10
      src/Shaders/MeshVisualizer.h
  3. 16
      src/Shaders/Phong.h
  4. 4
      src/Shaders/Vector.h
  5. 2
      src/Shaders/VertexColor.h

10
src/Shaders/DistanceFieldVector.h

@ -49,7 +49,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
DistanceFieldVector(); DistanceFieldVector();
/** @brief Set transformation and projection matrix */ /** @brief Set transformation and projection matrix */
inline DistanceFieldVector* setTransformationProjectionMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) { DistanceFieldVector* setTransformationProjectionMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) {
AbstractShaderProgram::setUniform(transformationProjectionMatrixUniform, matrix); AbstractShaderProgram::setUniform(transformationProjectionMatrixUniform, matrix);
return this; return this;
} }
@ -60,7 +60,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* *
* @see setOutlineColor() * @see setOutlineColor()
*/ */
inline DistanceFieldVector* setColor(const Color4<>& color) { DistanceFieldVector* setColor(const Color4<>& color) {
AbstractShaderProgram::setUniform(colorUniform, color); AbstractShaderProgram::setUniform(colorUniform, color);
return this; return this;
} }
@ -71,7 +71,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* *
* @see setOutlineRange(), setColor() * @see setOutlineRange(), setColor()
*/ */
inline DistanceFieldVector* setOutlineColor(const Color4<>& color) { DistanceFieldVector* setOutlineColor(const Color4<>& color) {
AbstractShaderProgram::setUniform(outlineColorUniform, color); AbstractShaderProgram::setUniform(outlineColorUniform, color);
return this; return this;
} }
@ -90,7 +90,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* *
* @see setOutlineColor() * @see setOutlineColor()
*/ */
inline DistanceFieldVector* setOutlineRange(Float start, Float end) { DistanceFieldVector* setOutlineRange(Float start, Float end) {
AbstractShaderProgram::setUniform(outlineRangeUniform, Vector2(start, end)); AbstractShaderProgram::setUniform(outlineRangeUniform, Vector2(start, end));
return this; return this;
} }
@ -103,7 +103,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT DistanceFieldVector
* values will make them look more crisp (but possibly aliased). Initial * values will make them look more crisp (but possibly aliased). Initial
* value is `0.04f`. * value is `0.04f`.
*/ */
inline DistanceFieldVector* setSmoothness(Float value) { DistanceFieldVector* setSmoothness(Float value) {
AbstractShaderProgram::setUniform(smoothnessUniform, value); AbstractShaderProgram::setUniform(smoothnessUniform, value);
return this; return this;
} }

10
src/Shaders/MeshVisualizer.h

@ -71,7 +71,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* @brief Set transformation and projection matrix * @brief Set transformation and projection matrix
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
inline MeshVisualizer* setTransformationProjectionMatrix(const Matrix4& matrix) { MeshVisualizer* setTransformationProjectionMatrix(const Matrix4& matrix) {
setUniform(transformationProjectionMatrixUniform, matrix); setUniform(transformationProjectionMatrixUniform, matrix);
return this; return this;
} }
@ -82,7 +82,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* *
* Has effect only if @ref Flag "Flag::Wireframe" is enabled. * Has effect only if @ref Flag "Flag::Wireframe" is enabled.
*/ */
inline MeshVisualizer* setViewportSize(const Vector2& size) { MeshVisualizer* setViewportSize(const Vector2& size) {
setUniform(viewportSizeUniform, size); setUniform(viewportSizeUniform, size);
return this; return this;
} }
@ -93,7 +93,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* *
* Initial value is fully opaque white. * Initial value is fully opaque white.
*/ */
inline MeshVisualizer* setColor(const Color4<>& color) { MeshVisualizer* setColor(const Color4<>& color) {
setUniform(colorUniform, color); setUniform(colorUniform, color);
return this; return this;
} }
@ -105,7 +105,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* Initial value is fully opaque black. Has effect only if * Initial value is fully opaque black. Has effect only if
* @ref Flag "Flag::Wireframe" is enabled. * @ref Flag "Flag::Wireframe" is enabled.
*/ */
inline MeshVisualizer* setWireframeColor(const Color4<>& color) { MeshVisualizer* setWireframeColor(const Color4<>& color) {
if(flags & Flag::Wireframe) setUniform(wireframeColorUniform, color); if(flags & Flag::Wireframe) setUniform(wireframeColorUniform, color);
return this; return this;
} }
@ -117,7 +117,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* Initial value is `1.0f`. Has effect only if * Initial value is `1.0f`. Has effect only if
* @ref Flag "Flag::Wireframe" is enabled. * @ref Flag "Flag::Wireframe" is enabled.
*/ */
inline MeshVisualizer* setWireframeWidth(Float width) { MeshVisualizer* setWireframeWidth(Float width) {
if(flags & Flag::Wireframe) setUniform(wireframeWidthUniform, width); if(flags & Flag::Wireframe) setUniform(wireframeWidthUniform, width);
return this; return this;
} }

16
src/Shaders/Phong.h

@ -55,7 +55,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* *
* If not set, default value is `(0.0f, 0.0f, 0.0f)`. * If not set, default value is `(0.0f, 0.0f, 0.0f)`.
*/ */
inline Phong* setAmbientColor(const Color3<>& color) { Phong* setAmbientColor(const Color3<>& color) {
setUniform(ambientColorUniform, color); setUniform(ambientColorUniform, color);
return this; return this;
} }
@ -64,7 +64,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* @brief Set diffuse color * @brief Set diffuse color
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
inline Phong* setDiffuseColor(const Color3<>& color) { Phong* setDiffuseColor(const Color3<>& color) {
setUniform(diffuseColorUniform, color); setUniform(diffuseColorUniform, color);
return this; return this;
} }
@ -75,7 +75,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* *
* If not set, default value is `(1.0f, 1.0f, 1.0f)`. * If not set, default value is `(1.0f, 1.0f, 1.0f)`.
*/ */
inline Phong* setSpecularColor(const Color3<>& color) { Phong* setSpecularColor(const Color3<>& color) {
setUniform(specularColorUniform, color); setUniform(specularColorUniform, color);
return this; return this;
} }
@ -87,7 +87,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* The larger value, the harder surface (smaller specular highlight). * The larger value, the harder surface (smaller specular highlight).
* If not set, default value is `80.0f`. * If not set, default value is `80.0f`.
*/ */
inline Phong* setShininess(Float shininess) { Phong* setShininess(Float shininess) {
setUniform(shininessUniform, shininess); setUniform(shininessUniform, shininess);
return this; return this;
} }
@ -96,7 +96,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* @brief Set transformation and normal matrix * @brief Set transformation and normal matrix
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
inline Phong* setTransformationMatrix(const Matrix4& matrix) { Phong* setTransformationMatrix(const Matrix4& matrix) {
setUniform(transformationMatrixUniform, matrix); setUniform(transformationMatrixUniform, matrix);
setUniform(normalMatrixUniform, matrix.rotation()); setUniform(normalMatrixUniform, matrix.rotation());
return this; return this;
@ -106,7 +106,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* @brief Set projection matrix * @brief Set projection matrix
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
inline Phong* setProjectionMatrix(const Matrix4& matrix) { Phong* setProjectionMatrix(const Matrix4& matrix) {
setUniform(projectionMatrixUniform, matrix); setUniform(projectionMatrixUniform, matrix);
return this; return this;
} }
@ -115,7 +115,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* @brief Set light position * @brief Set light position
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
inline Phong* setLightPosition(const Vector3& light) { Phong* setLightPosition(const Vector3& light) {
setUniform(lightUniform, light); setUniform(lightUniform, light);
return this; return this;
} }
@ -126,7 +126,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* *
* If not set, default value is `(1.0f, 1.0f, 1.0f)`. * If not set, default value is `(1.0f, 1.0f, 1.0f)`.
*/ */
inline Phong* setLightColor(const Color3<>& color) { Phong* setLightColor(const Color3<>& color) {
setUniform(lightColorUniform, color); setUniform(lightColorUniform, color);
return this; return this;
} }

4
src/Shaders/Vector.h

@ -51,7 +51,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Vector: public Abst
* @brief Set transformation and projection matrix * @brief Set transformation and projection matrix
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
inline Vector* setTransformationProjectionMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) { Vector* setTransformationProjectionMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) {
AbstractShaderProgram::setUniform(transformationProjectionMatrixUniform, matrix); AbstractShaderProgram::setUniform(transformationProjectionMatrixUniform, matrix);
return this; return this;
} }
@ -60,7 +60,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Vector: public Abst
* @brief Set fill color * @brief Set fill color
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
*/ */
inline Vector* setColor(const Color4<>& color) { Vector* setColor(const Color4<>& color) {
AbstractShaderProgram::setUniform(colorUniform, color); AbstractShaderProgram::setUniform(colorUniform, color);
return this; return this;
} }

2
src/Shaders/VertexColor.h

@ -60,7 +60,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT VertexColor: public
* *
* Default is identity matrix. * Default is identity matrix.
*/ */
inline VertexColor<dimensions>* setTransformationProjectionMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) { VertexColor<dimensions>* setTransformationProjectionMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) {
setUniform(transformationProjectionMatrixUniform, matrix); setUniform(transformationProjectionMatrixUniform, matrix);
return this; return this;
} }

Loading…
Cancel
Save