Browse Source

Properly unbind pixel pack buffer in Framebuffer::read(Image).

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
98e6f513b4
  1. 3
      src/Magnum/AbstractFramebuffer.cpp

3
src/Magnum/AbstractFramebuffer.cpp

@ -281,6 +281,9 @@ AbstractFramebuffer& AbstractFramebuffer::clear(const FramebufferClearMask mask)
void AbstractFramebuffer::read(const Range2Di& rectangle, Image2D& image) {
bindInternal(FramebufferTarget::Read);
Containers::Array<char> data{Implementation::imageDataSizeFor(image, rectangle.size())};
#ifndef MAGNUM_TARGET_GLES2
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
#endif
(Context::current()->state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), data.size(), data);
image.setData(image.storage(), image.format(), image.type(), rectangle.size(), std::move(data));
}

Loading…
Cancel
Save