Browse Source

Don't reset viewport if binding framebuffer for reading only.

Caused assertion. Anyway, I need to clean up that mess with framebuffer
binding. Nobody needs to bind it for reading.
pull/87/head
Vladimír Vondruš 11 years ago
parent
commit
bd8db7e66b
  1. 7
      src/Magnum/AbstractFramebuffer.cpp

7
src/Magnum/AbstractFramebuffer.cpp

@ -93,9 +93,12 @@ void AbstractFramebuffer::createIfNotAlready() {
CORRADE_INTERNAL_ASSERT(_created);
}
void AbstractFramebuffer::bind(FramebufferTarget target) {
void AbstractFramebuffer::bind(const FramebufferTarget target) {
bindInternal(target);
setViewportInternal();
/* Ensure the viewport is set if the user is going to draw */
if(target == FramebufferTarget::Draw || target == FramebufferTarget::ReadDraw)
setViewportInternal();
}
void AbstractFramebuffer::bindInternal(FramebufferTarget target) {

Loading…
Cancel
Save