diff --git a/src/Magnum/GL/DefaultFramebuffer.cpp b/src/Magnum/GL/DefaultFramebuffer.cpp index 4ca97c60b..7202d334d 100644 --- a/src/Magnum/GL/DefaultFramebuffer.cpp +++ b/src/Magnum/GL/DefaultFramebuffer.cpp @@ -98,12 +98,7 @@ DefaultFramebuffer& DefaultFramebuffer::mapForRead(const ReadAttachment attachme } void DefaultFramebuffer::invalidate(Containers::ArrayView attachments) { - /** @todo C++14: use VLA to avoid heap allocation */ - Containers::Array _attachments(attachments.size()); - for(std::size_t i = 0; i != attachments.size(); ++i) - _attachments[i] = GLenum(*(attachments.begin()+i)); - - Context::current().state().framebuffer.invalidateImplementation(*this, attachments.size(), _attachments); + Context::current().state().framebuffer.invalidateImplementation(*this, attachments.size(), reinterpret_cast(attachments.data())); } void DefaultFramebuffer::invalidate(std::initializer_list attachments) { @@ -113,12 +108,7 @@ void DefaultFramebuffer::invalidate(std::initializer_list attachments, const Range2Di& rectangle) { - /** @todo C++14: use VLA to avoid heap allocation */ - Containers::Array _attachments(attachments.size()); - for(std::size_t i = 0; i != attachments.size(); ++i) - _attachments[i] = GLenum(*(attachments.begin()+i)); - - Context::current().state().framebuffer.invalidateSubImplementation(*this, attachments.size(), _attachments, rectangle); + Context::current().state().framebuffer.invalidateSubImplementation(*this, attachments.size(), reinterpret_cast(attachments.data()), rectangle); } void DefaultFramebuffer::invalidate(std::initializer_list attachments, const Range2Di& rectangle) { diff --git a/src/Magnum/GL/Framebuffer.cpp b/src/Magnum/GL/Framebuffer.cpp index 7b0ad4716..300ab545d 100644 --- a/src/Magnum/GL/Framebuffer.cpp +++ b/src/Magnum/GL/Framebuffer.cpp @@ -223,12 +223,7 @@ Framebuffer& Framebuffer::mapForRead(const ColorAttachment attachment) { } void Framebuffer::invalidate(const Containers::ArrayView attachments) { - /** @todo C++14: use VLA to avoid heap allocation */ - Containers::Array _attachments(attachments.size()); - for(std::size_t i = 0; i != attachments.size(); ++i) - _attachments[i] = GLenum(*(attachments.begin()+i)); - - Context::current().state().framebuffer.invalidateImplementation(*this, attachments.size(), _attachments); + Context::current().state().framebuffer.invalidateImplementation(*this, attachments.size(), reinterpret_cast(attachments.data())); } void Framebuffer::invalidate(const std::initializer_list attachments) { @@ -237,12 +232,7 @@ void Framebuffer::invalidate(const std::initializer_list #ifndef MAGNUM_TARGET_GLES2 void Framebuffer::invalidate(const Containers::ArrayView attachments, const Range2Di& rectangle) { - /** @todo C++14: use VLA to avoid heap allocation */ - Containers::Array _attachments(attachments.size()); - for(std::size_t i = 0; i != attachments.size(); ++i) - _attachments[i] = GLenum(*(attachments.begin()+i)); - - Context::current().state().framebuffer.invalidateSubImplementation(*this, attachments.size(), _attachments, rectangle); + Context::current().state().framebuffer.invalidateSubImplementation(*this, attachments.size(), reinterpret_cast(attachments.data()), rectangle); } void Framebuffer::invalidate(const std::initializer_list attachments, const Range2Di& rectangle) {