diff --git a/src/ACGL/OpenGL/Objects/FrameBufferObject.cc b/src/ACGL/OpenGL/Objects/FrameBufferObject.cc index d3ab704b8f53f9acd7cecd87fb3118ccf0b9babc..378cd8b6038ccb4069d873602eab15e2567b4a94 100644 --- a/src/ACGL/OpenGL/Objects/FrameBufferObject.cc +++ b/src/ACGL/OpenGL/Objects/FrameBufferObject.cc @@ -154,6 +154,19 @@ void FrameBufferObject::remapAttachments() // end debug bind(); // glDrawBuffers will get part of the FBO state! + +#ifdef __APPLE__ + // Somehow, Apple's current (OSX 10.7) OpenGL implementation skips over all + // GL_NONE entries in the bufferMappings array if the only color attachment + // specified is GL_COLOR_ATTACHMENT0. + // This however causes that no change from the initial FBO state is + // detected when the only color attachment should be assigned to a FragData + // location other than 0. + // Hotfix: Temporarily set all draw buffers to GL_NONE before setting the + // actual configuration: + glDrawBuffers(0, (GLenum*)NULL); +#endif // __APPLE__ + glDrawBuffers( maxColorBuffers, bufferMappings ); delete[] bufferMappings;