Skip to content

Commit 23cb45b

Browse files
mbaetgen-wupkblaschke
authored andcommitted
Bugfix: Reset default framebuffer to back after rendering
1 parent 6b1dc9c commit 23cb45b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/libprojectM/ProjectM.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ void ProjectM::RenderFrame()
168168

169169
// ToDo: Allow external apps to provide a custom target framebuffer.
170170
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
171+
glViewport(0, 0, renderContext.viewportSizeX, renderContext.viewportSizeY);
172+
173+
#ifdef USE_GLES
174+
// On WebGL2 / Chrome ANGLE, the default framebuffer's draw buffer must
175+
// be explicitly set to GL_BACK after preset rendering, which may leave
176+
// per-FBO draw buffer state that leaks into FBO 0 on some drivers.
177+
GLenum backBuf = GL_BACK;
178+
glDrawBuffers(1, &backBuf);
179+
#endif
171180

172181
if (m_transition != nullptr && m_transitioningPreset != nullptr)
173182
{

0 commit comments

Comments
 (0)