Browse Source

GL: restore backwards compatibility of deprecated Buffer::map<T>().

Calling map<void>() was trying to instantiate ArrayView<void> through
arrayCast<void>(), which is not possible (void has no size etc etc.).
Casting the returned pointer directly instead. Thanks to @AndySomogyi
for pointing this out.
pull/280/head
Vladimír Vondruš 8 years ago
parent
commit
943d74dd1c
  1. 3
      doc/changelog.dox
  2. 2
      src/Magnum/GL/Buffer.h

3
doc/changelog.dox

@ -167,6 +167,9 @@ See also:
optional, defaults to @ref GL::BufferUsage::StaticDraw
- Re-enabled @fn_gl{DrawRangeElements} for WebGL 2 (see
[mosra/magnum#97](https://github.com/mosra/magnum/issues/97))
- Restored backwards compatibility to the templated @ref GL::Buffer::map()
overload --- it was not possible to call it with @cpp void @ce template
parameter
@subsubsection changelog-latest-changes-math Math library

2
src/Magnum/GL/Buffer.h

@ -1167,7 +1167,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject {
* instead.
*/
template<class T> CORRADE_DEPRECATED("use non-templated map() and Containers::arrayCast() instead") T* map(GLintptr offset, GLsizeiptr length, MapFlags flags) {
return Containers::arrayCast<T>(map(offset, length, flags));
return reinterpret_cast<T*>(map(offset, length, flags).data());
}
#endif

Loading…
Cancel
Save