From cecb4863f7c786153513b88dfdb3d32f516e0c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 30 May 2015 13:36:11 +0200 Subject: [PATCH] Fix internal framebuffer binding on WebGL. For some weird reason this was failing only on the Viewer example and not anywhere else. Huh. --- src/Magnum/AbstractFramebuffer.cpp | 12 ++++++------ src/Magnum/Implementation/FramebufferState.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Magnum/AbstractFramebuffer.cpp b/src/Magnum/AbstractFramebuffer.cpp index 44032aef8..daa0cd845 100644 --- a/src/Magnum/AbstractFramebuffer.cpp +++ b/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 } diff --git a/src/Magnum/Implementation/FramebufferState.h b/src/Magnum/Implementation/FramebufferState.h index a98341de6..fc78d0589 100644 --- a/src/Magnum/Implementation/FramebufferState.h +++ b/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