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

2
src/Magnum/Implementation/FramebufferState.h

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

Loading…
Cancel
Save