Browse Source

Marking deprecated functions and types with CORRADE_DEPRECATED().

Sadly enum values can't be marked as such.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
79ff9e1ca4
  1. 2
      src/AbstractShaderProgram.h
  2. 2
      src/AbstractTexture.h
  3. 6
      src/Buffer.h
  4. 4
      src/ImageFormat.h
  5. 16
      src/Magnum.h
  6. 6
      src/Math/Geometry/Rectangle.h
  7. 2
      src/Sampler.h
  8. 4
      src/SceneGraph/Animable.h
  9. 2
      src/Swizzle.h
  10. 10
      src/Text/TextRenderer.h

2
src/AbstractShaderProgram.h

@ -340,7 +340,7 @@ class MAGNUM_EXPORT AbstractShaderProgram {
* @deprecated Use @ref Magnum::AbstractShaderProgram::maxVertexAttributes() "maxVertexAttributes()" * @deprecated Use @ref Magnum::AbstractShaderProgram::maxVertexAttributes() "maxVertexAttributes()"
* instead. * instead.
*/ */
static Int maxSupportedVertexAttributeCount() { return maxVertexAttributes(); } static CORRADE_DEPRECATED("use maxVertexAttributes() instead") Int maxSupportedVertexAttributeCount() { return maxVertexAttributes(); }
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

2
src/AbstractTexture.h

@ -115,7 +115,7 @@ class MAGNUM_EXPORT AbstractTexture {
* @deprecated Use @ref Magnum::AbstractTexture::maxLayers() "maxLayers()" * @deprecated Use @ref Magnum::AbstractTexture::maxLayers() "maxLayers()"
* instead. * instead.
*/ */
static Int maxSupportedLayerCount() { return maxLayers(); } static CORRADE_DEPRECATED("use maxLayers() instead") Int maxSupportedLayerCount() { return maxLayers(); }
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

6
src/Buffer.h

@ -306,7 +306,7 @@ class MAGNUM_EXPORT Buffer {
* @copybrief BufferUsage * @copybrief BufferUsage
* @deprecated Use @ref Magnum::BufferUsage "BufferUsage" instead. * @deprecated Use @ref Magnum::BufferUsage "BufferUsage" instead.
*/ */
typedef BufferUsage Usage; typedef CORRADE_DEPRECATED("use BufferUsage instead") BufferUsage Usage;
#endif #endif
/** /**
@ -653,7 +653,7 @@ class MAGNUM_EXPORT Buffer {
* @deprecated Use @ref Magnum::Buffer::setData(Containers::ArrayReference<const void>, BufferUsage) "setData(Containers::ArrayReference<const void>, BufferUsage)" * @deprecated Use @ref Magnum::Buffer::setData(Containers::ArrayReference<const void>, BufferUsage) "setData(Containers::ArrayReference<const void>, BufferUsage)"
* instead. * instead.
*/ */
Buffer& setData(GLsizeiptr size, const GLvoid* data, BufferUsage usage) { CORRADE_DEPRECATED("use setData(Containers::ArrayReference, BufferUsage) instead") Buffer& setData(GLsizeiptr size, const GLvoid* data, BufferUsage usage) {
return setData({data, std::size_t(size)}, usage); return setData({data, std::size_t(size)}, usage);
} }
#endif #endif
@ -693,7 +693,7 @@ class MAGNUM_EXPORT Buffer {
* @deprecated Use @ref Magnum::Buffer::setSubData(GLintptr, Containers::ArrayReference<const void>) "setSubData(GLintptr, Containers::ArrayReference<const void>)" * @deprecated Use @ref Magnum::Buffer::setSubData(GLintptr, Containers::ArrayReference<const void>) "setSubData(GLintptr, Containers::ArrayReference<const void>)"
* instead. * instead.
*/ */
Buffer& setSubData(GLintptr offset, GLsizeiptr size, const GLvoid* data) { CORRADE_DEPRECATED("use setSubData(GLintptr, Containers::ArrayReference) instead") Buffer& setSubData(GLintptr offset, GLsizeiptr size, const GLvoid* data) {
return setSubData(offset, {data, std::size_t(size)}); return setSubData(offset, {data, std::size_t(size)});
} }
#endif #endif

4
src/ImageFormat.h

@ -38,13 +38,13 @@ namespace Magnum {
@copybrief ColorFormat @copybrief ColorFormat
@deprecated Use @ref Magnum::ColorFormat "ColorFormat" instead. @deprecated Use @ref Magnum::ColorFormat "ColorFormat" instead.
*/ */
typedef ColorFormat ImageFormat; typedef CORRADE_DEPRECATED("use ColorFormat instead") ColorFormat ImageFormat;
/** /**
@copybrief ColorType @copybrief ColorType
@deprecated Use @ref Magnum::ColorType "ColorType" instead. @deprecated Use @ref Magnum::ColorType "ColorType" instead.
*/ */
typedef ColorType ImageType; typedef CORRADE_DEPRECATED("use ColorType instead") ColorType ImageType;
} }
#else #else

16
src/Magnum.h

@ -34,6 +34,10 @@
#include "Types.h" #include "Types.h"
#include "magnumConfigure.h" #include "magnumConfigure.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Utility/Macros.h>
#endif
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
typedef unsigned int GLenum; /* Needed for *Format and *Type enums */ typedef unsigned int GLenum; /* Needed for *Format and *Type enums */
#endif #endif
@ -330,15 +334,15 @@ typedef Math::Range3D<Int> Range3Di;
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** /**
@copybrief Range2D @copybrief Range2D
@deprecated Use @ref Magnum::Range2D instead. @deprecated Use @ref Magnum::Range2D "Range2D" instead.
*/ */
typedef Math::Geometry::Rectangle<Float> Rectangle; typedef CORRADE_DEPRECATED("use Range2D instead") Math::Geometry::Rectangle<Float> Rectangle;
/** /**
@copybrief Range2Di @copybrief Range2Di
@deprecated Use @ref Magnum::Range2Di instead. @deprecated Use @ref Magnum::Range2Di "Range2Di" instead.
*/ */
typedef Math::Geometry::Rectangle<Int> Rectanglei; typedef CORRADE_DEPRECATED("use Range2Di instead") Math::Geometry::Rectangle<Int> Rectanglei;
#endif #endif
/*@}*/ /*@}*/
@ -388,7 +392,7 @@ typedef Math::Matrix<2, Double> Matrix2x2d;
@copybrief Matrix2x2d @copybrief Matrix2x2d
@deprecated Use @ref Magnum::Matrix2x2d "Matrix2x2d" instead. @deprecated Use @ref Magnum::Matrix2x2d "Matrix2x2d" instead.
*/ */
typedef Math::Matrix<2, Double> Matrix2d; typedef CORRADE_DEPRECATED("use Matrix2x2d instead") Math::Matrix<2, Double> Matrix2d;
#endif #endif
/** /**
@ -496,7 +500,7 @@ typedef Math::Range3D<Double> Range3Dd;
@copybrief Range2Dd @copybrief Range2Dd
@deprecated Use @ref Magnum::Range2Dd instead. @deprecated Use @ref Magnum::Range2Dd instead.
*/ */
typedef Math::Geometry::Rectangle<Double> Rectangled; typedef CORRADE_DEPRECATED("use Range2Dd instead") Math::Geometry::Rectangle<Double> Rectangled;
#endif #endif
/*@}*/ /*@}*/

6
src/Math/Geometry/Rectangle.h

@ -32,13 +32,15 @@
#include "Math/Range.h" #include "Math/Range.h"
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
#include <Utility/Macros.h>
namespace Magnum { namespace Math { namespace Geometry { namespace Magnum { namespace Math { namespace Geometry {
/** /**
@copybrief Math::Range2D @copybrief Math::Range2D
@deprecated Use @ref Magnum::Math::Range2D instead. @deprecated Use @ref Magnum::Math::Range2D "Math::Range2D" instead.
*/ */
template<class T> class Rectangle: public Range2D<T> { template<class T> class CORRADE_DEPRECATED("use Math::Range2D instead") Rectangle: public Range2D<T> {
public: public:
/** @copydoc Range2D() */ /** @copydoc Range2D() */
constexpr Rectangle() = default; constexpr Rectangle() = default;

2
src/Sampler.h

@ -149,7 +149,7 @@ class MAGNUM_EXPORT Sampler {
* @deprecated Use @ref Magnum::Sampler::maxAnisotropy() "maxAnisotropy()" * @deprecated Use @ref Magnum::Sampler::maxAnisotropy() "maxAnisotropy()"
* instead. * instead.
*/ */
static Float maxSupportedAnisotropy() { return maxAnisotropy(); } static CORRADE_DEPRECATED("use maxAnisotropy() instead") Float maxSupportedAnisotropy() { return maxAnisotropy(); }
#endif #endif
}; };

4
src/SceneGraph/Animable.h

@ -229,14 +229,14 @@ template<UnsignedInt dimensions, class T> class Animable: public AbstractGrouped
* @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()" * @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()"
* instead. * instead.
*/ */
AnimableGroup<dimensions, T>* group() { return animables(); } CORRADE_DEPRECATED("use animables() instead") AnimableGroup<dimensions, T>* group() { return animables(); }
/** /**
* @copydoc animables() * @copydoc animables()
* @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()" * @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()"
* instead. * instead.
*/ */
const AnimableGroup<dimensions, T>* group() const { return animables(); } CORRADE_DEPRECATED("use animables() instead") const AnimableGroup<dimensions, T>* group() const { return animables(); }
#endif #endif
protected: protected:

2
src/Swizzle.h

@ -41,7 +41,7 @@ namespace Magnum {
@deprecated Use @ref Magnum::Math::swizzle() "Math::swizzle()" instead. @deprecated Use @ref Magnum::Math::swizzle() "Math::swizzle()" instead.
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
template<char ...components, class T> constexpr typename Math::Implementation::TypeForSize<sizeof...(components), T>::Type swizzle(const T& vector); template<char ...components, class T> constexpr CORRADE_DEPRECATED("use Math::swizzle() instead") typename Math::Implementation::TypeForSize<sizeof...(components), T>::Type swizzle(const T& vector);
#else #else
using Math::swizzle; using Math::swizzle;
#endif #endif

10
src/Text/TextRenderer.h

@ -3,24 +3,24 @@
#include "Text/Renderer.h" #include "Text/Renderer.h"
#ifdef MAGNUM_BUILD_DEPRECATED
namespace Magnum { namespace Text { namespace Magnum { namespace Text {
#ifdef MAGNUM_BUILD_DEPRECATED
/** /**
@copybrief Renderer2D @copybrief Renderer2D
@deprecated Use @ref Magnum::Text::Renderer2D "Renderer2D" instead. @deprecated Use @ref Magnum::Text::Renderer2D "Renderer2D" instead.
*/ */
typedef Renderer<2> TextRenderer2D; typedef CORRADE_DEPRECATED("use Renderer2D instead") Renderer<2> TextRenderer2D;
/** /**
@copybrief Renderer3D @copybrief Renderer3D
@deprecated Use @ref Magnum::Text::Renderer3D "Renderer3D" instead. @deprecated Use @ref Magnum::Text::Renderer3D "Renderer3D" instead.
*/ */
typedef Renderer<3> TextRenderer3D; typedef CORRADE_DEPRECATED("use Renderer2D instead") Renderer<3> TextRenderer3D;
}}
#else #else
#error #error
#endif #endif
}}
#endif #endif

Loading…
Cancel
Save