From a9bfbbd08eaedd2e2e65ca4a45697c539a9b4cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 17 Jan 2015 16:01:42 +0100 Subject: [PATCH] Deprecated Mesh::maxVertexAttributes(). It is not related to Mesh itself at all, as the attribute indices are defined in Attribute class. Use AbstractShaderProgram::maxVertexAttributes() instead. --- src/Magnum/Mesh.cpp | 4 ++++ src/Magnum/Mesh.h | 22 ++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index 284014795..75560ece1 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -27,7 +27,9 @@ #include +#ifdef MAGNUM_BUILD_DEPRECATED #include "Magnum/AbstractShaderProgram.h" +#endif #include "Magnum/Buffer.h" #include "Magnum/Context.h" #include "Magnum/Extensions.h" @@ -39,7 +41,9 @@ namespace Magnum { +#ifdef MAGNUM_BUILD_DEPRECATED Int Mesh::maxVertexAttributes() { return AbstractShaderProgram::maxVertexAttributes(); } +#endif #ifndef MAGNUM_TARGET_GLES2 Long Mesh::maxElementIndex() { diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index 55726b1ee..2d77c6d29 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -323,7 +323,7 @@ used instead of binding the buffers and specifying vertex attribute pointers in each @ref draw() call. The engine tracks currently bound VAO and currently active shader program to avoid unnecessary calls to @fn_gl{BindVertexArray} and @fn_gl{UseProgram}. Mesh limits and implementation-defined values (such as -@ref maxVertexAttributes()) are cached, so repeated queries don't result in +@ref maxElementIndex()) are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. If extension @extension{EXT,direct_state_access} and VAOs are available, @@ -365,15 +365,13 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { UnsignedInt = GL_UNSIGNED_INT }; + #ifdef MAGNUM_BUILD_DEPRECATED /** - * @brief Max supported vertex attribute count - * - * The result is cached, repeated queries don't result in repeated - * OpenGL calls. This function is in fact alias to - * @ref AbstractShaderProgram::maxVertexAttributes(). - * @see @ref addVertexBuffer() + * @copybrief AbstractShaderProgram::maxVertexAttributes() + * @deprecated Use @ref AbstractShaderProgram::maxVertexAttributes() instead. */ - static Int maxVertexAttributes(); + CORRADE_DEPRECATED("use AbstractShaderProgram::maxVertexAttributes() instead") static Int maxVertexAttributes(); + #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -697,8 +695,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { * must be at most 255 bytes. This is not required anywhere else, * but doing so may have performance benefits. * - * @see @ref addVertexBufferInstanced(), @ref maxVertexAttributes(), - * @ref setPrimitive(), @ref setCount(), @fn_gl{BindVertexArray}, + * @see @ref addVertexBufferInstanced(), @ref setPrimitive(), + * @ref setCount(), @fn_gl{BindVertexArray}, * @fn_gl{EnableVertexAttribArray}, @fn_gl{BindBuffer}, * @fn_gl{VertexAttribPointer} or * @fn_gl_extension{EnableVertexArrayAttrib,EXT,direct_state_access}, @@ -722,8 +720,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { * ES 3.0 or @es_extension{OES,vertex_array_object} in OpenGL ES 2.0 is * available, the vertex array object is used to hold the parameters. * - * @see @ref maxVertexAttributes(), @ref setPrimitive(), - * @ref setCount(), @ref setInstanceCount(), @ref setBaseInstance(), + * @see @ref setPrimitive(), @ref setCount(), @ref setInstanceCount(), + * @ref setBaseInstance(), * @fn_gl{BindVertexArray}, @fn_gl{EnableVertexAttribArray}, * @fn_gl{BindBuffer}, @fn_gl{VertexAttribPointer}, * @fn_gl{VertexAttribDivisor} or