Browse Source

Fix internal framebuffer binding on WebGL.

For some weird reason this was failing only on the Viewer example and
not anywhere else. Huh.
pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
cecb4863f7
  1. 12
      src/Magnum/AbstractFramebuffer.cpp
  2. 2
      src/Magnum/Implementation/FramebufferState.h

12
src/Magnum/AbstractFramebuffer.cpp

@ -105,10 +105,10 @@ void AbstractFramebuffer::bind() {
}
void AbstractFramebuffer::bindInternal(FramebufferTarget target) {
#ifndef MAGNUM_TARGET_GLES2
bindImplementationDefault(target);
#else
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
(this->*Context::current()->state().framebuffer->bindImplementation)(target);
#else
bindImplementationDefault(target);
#endif
}
@ -146,10 +146,10 @@ void AbstractFramebuffer::bindImplementationDefault(FramebufferTarget target) {
}
FramebufferTarget AbstractFramebuffer::bindInternal() {
#ifndef MAGNUM_TARGET_GLES2
return bindImplementationDefault();
#else
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
return (this->*Context::current()->state().framebuffer->bindInternalImplementation)();
#else
return bindImplementationDefault();
#endif
}

2
src/Magnum/Implementation/FramebufferState.h

@ -54,7 +54,7 @@ struct FramebufferState {
#ifndef MAGNUM_TARGET_GLES2
void(AbstractFramebuffer::*invalidateSubImplementation)(GLsizei, const GLenum*, const Range2Di&);
#endif
#ifdef MAGNUM_TARGET_GLES2
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void(AbstractFramebuffer::*bindImplementation)(FramebufferTarget);
FramebufferTarget(AbstractFramebuffer::*bindInternalImplementation)();
#endif

Loading…
Cancel
Save