From ecc0ab6a59cf49d09212bd6f69ba58a3a21275d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Mar 2019 12:37:22 +0100 Subject: [PATCH] GL: removed long-deprecated templated Buffer data access APIs. --- doc/changelog.dox | 4 +++ src/Magnum/GL/Buffer.cpp | 7 ----- src/Magnum/GL/Buffer.h | 62 ---------------------------------------- 3 files changed, 4 insertions(+), 69 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index cbeee38cf..5bc331cd0 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -308,6 +308,10 @@ See also: - Removed all aliases to @ref GL library functionality in the root namespace (and root include path) which were deprecated in 2018.04 +- Removed templated overloads of @ref GL::Buffer::data(), + @ref GL::Buffer::subData() and @ref GL::Buffer::map() deprecated since + 2017. Use the non-templated versions together with + @ref Corrade::Containers::arrayCast(). - Removed the `Shapes` library together with `DebugTools::ShapeRenderer`, which was a failed design experiment deprecated since version 2018.10 (see [mosra/magnum#148](https://github.com/mosra/magnum/issues/148)) diff --git a/src/Magnum/GL/Buffer.cpp b/src/Magnum/GL/Buffer.cpp index e90f7d328..24566f4db 100644 --- a/src/Magnum/GL/Buffer.cpp +++ b/src/Magnum/GL/Buffer.cpp @@ -359,13 +359,6 @@ Containers::Array Buffer::subData(const GLintptr offset, const GLsizeiptr if(size) (this->*Context::current().state().buffer->getSubDataImplementation)(offset, size, data); return data; } - -/** @todo remove when this is not used anymore */ -#ifdef MAGNUM_BUILD_DEPRECATED -void Buffer::subDataInternal(GLintptr offset, GLsizeiptr size, GLvoid* data) { - (this->*Context::current().state().buffer->getSubDataImplementation)(offset, size, data); -} -#endif #endif #ifndef MAGNUM_TARGET_GLES2 diff --git a/src/Magnum/GL/Buffer.h b/src/Magnum/GL/Buffer.h index eef84717c..1b0d5be77 100644 --- a/src/Magnum/GL/Buffer.h +++ b/src/Magnum/GL/Buffer.h @@ -40,11 +40,6 @@ #include "Magnum/GL/AbstractObject.h" #include "Magnum/GL/GL.h" -#ifdef MAGNUM_BUILD_DEPRECATED -#include -#include -#endif - namespace Magnum { namespace GL { /** @@ -961,15 +956,6 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { */ Containers::Array data(); - #ifdef MAGNUM_BUILD_DEPRECATED - /** @brief @copybrief data() - * @deprecated Use non-templated @ref subData() and @ref Containers::arrayCast() - * instead. - */ - /* MinGW complains loudly if the declaration doesn't also have inline */ - template CORRADE_DEPRECATED("use non-templated data() and Containers::arrayCast() instead") inline Containers::Array data(); - #endif - /** * @brief Buffer subdata * @param offset Byte offset in the buffer @@ -987,14 +973,6 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * in OpenGL ES instead. */ Containers::Array subData(GLintptr offset, GLsizeiptr size); - - #ifdef MAGNUM_BUILD_DEPRECATED - /** @brief @copybrief subData() - * @deprecated Use non-templated @ref subData() and @ref Containers::arrayCast() instead - */ - /* MinGW complains loudly if the declaration doesn't also have inline */ - template CORRADE_DEPRECATED("use non-templated subData() and Containers::arrayCast() instead") inline Containers::Array subData(GLintptr offset, GLsizeiptr size); - #endif #endif /** @@ -1103,16 +1081,6 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { const char* mapRead() { return map(MapAccess::ReadOnly); } #endif - #ifdef MAGNUM_BUILD_DEPRECATED - /** @overload - * @deprecated Use non-templated @ref map() and cast the result - * manually instead. - */ - template CORRADE_DEPRECATED("use non-templated map() and cast the result manually instead") T* map(MapAccess access) { - return reinterpret_cast(map(access)); - } - #endif - /** * @brief Map buffer to client memory * @param offset Byte offset into the buffer @@ -1144,16 +1112,6 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { return map(offset, length, flags|MapFlag::Read); } - #ifdef MAGNUM_BUILD_DEPRECATED - /** @overload - * @deprecated Use non-templated @ref map() and @ref Containers::arrayCast() - * instead. - */ - template CORRADE_DEPRECATED("use non-templated map() and Containers::arrayCast() instead") T* map(GLintptr offset, GLsizeiptr length, MapFlags flags) { - return reinterpret_cast(map(offset, length, flags).data()); - } - #endif - /** * @brief Flush mapped range * @param offset Byte offset relative to start of mapped range @@ -1245,10 +1203,6 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { Buffer& setLabelInternal(Containers::ArrayView label); #endif - #if !defined(MAGNUM_TARGET_GLES) && defined(MAGNUM_BUILD_DEPRECATED) - CORRADE_DEPRECATED("used only by deprecated subData()") void subDataInternal(GLintptr offset, GLsizeiptr size, GLvoid* data); - #endif - void MAGNUM_GL_LOCAL getParameterImplementationDefault(GLenum value, GLint* data); #ifndef MAGNUM_TARGET_GLES void MAGNUM_GL_LOCAL getParameterImplementationDSA(GLenum value, GLint* data); @@ -1339,22 +1293,6 @@ inline GLuint Buffer::release() { return id; } -#if !defined(MAGNUM_TARGET_GLES) && defined(MAGNUM_BUILD_DEPRECATED) -CORRADE_IGNORE_DEPRECATED_PUSH -template Containers::Array inline Buffer::data() { - const Int bufferSize = size(); - CORRADE_ASSERT(bufferSize%sizeof(T) == 0, "Buffer::data(): the buffer size is" << bufferSize << "bytes, which can't be expressed as array of types with size" << sizeof(T), nullptr); - return subData(0, bufferSize/sizeof(T)); -} - -template Containers::Array inline Buffer::subData(const GLintptr offset, const GLsizeiptr size) { - Containers::Array data(size); - if(size) subDataInternal(offset, size*sizeof(T), data); - return data; -} -CORRADE_IGNORE_DEPRECATED_POP -#endif - }} #endif