Browse Source

GL: removed long-deprecated templated Buffer data access APIs.

pull/331/head
Vladimír Vondruš 7 years ago
parent
commit
ecc0ab6a59
  1. 4
      doc/changelog.dox
  2. 7
      src/Magnum/GL/Buffer.cpp
  3. 62
      src/Magnum/GL/Buffer.h

4
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))

7
src/Magnum/GL/Buffer.cpp

@ -359,13 +359,6 @@ Containers::Array<char> 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

62
src/Magnum/GL/Buffer.h

@ -40,11 +40,6 @@
#include "Magnum/GL/AbstractObject.h"
#include "Magnum/GL/GL.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Containers/Array.h>
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum { namespace GL {
/**
@ -961,15 +956,6 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject {
*/
Containers::Array<char> 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<class T> CORRADE_DEPRECATED("use non-templated data() and Containers::arrayCast() instead") inline Containers::Array<T> 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<char> 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<class T> CORRADE_DEPRECATED("use non-templated subData() and Containers::arrayCast() instead") inline Containers::Array<T> 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<class T> CORRADE_DEPRECATED("use non-templated map() and cast the result manually instead") T* map(MapAccess access) {
return reinterpret_cast<T*>(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<class T> CORRADE_DEPRECATED("use non-templated map() and Containers::arrayCast() instead") T* map(GLintptr offset, GLsizeiptr length, MapFlags flags) {
return reinterpret_cast<T*>(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<const char> label);
#endif
#if !defined(MAGNUM_TARGET_GLES) && defined(MAGNUM_BUILD_DEPRECATED)
CORRADE_DEPRECATED("used only by deprecated subData<T>()") 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<class T> Containers::Array<T> 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<T>(0, bufferSize/sizeof(T));
}
template<class T> Containers::Array<T> inline Buffer::subData(const GLintptr offset, const GLsizeiptr size) {
Containers::Array<T> data(size);
if(size) subDataInternal(offset, size*sizeof(T), data);
return data;
}
CORRADE_IGNORE_DEPRECATED_POP
#endif
}}
#endif

Loading…
Cancel
Save