diff --git a/library/cgp/13_opengl/fbo/fbo.cpp b/library/cgp/13_opengl/fbo/fbo.cpp index 76f434c..1122137 100644 --- a/library/cgp/13_opengl/fbo/fbo.cpp +++ b/library/cgp/13_opengl/fbo/fbo.cpp @@ -34,7 +34,7 @@ namespace cgp{ // Initialize texture texture.initialize_texture_2d_on_gpu(width, height, GL_DEPTH_COMPONENT, GL_TEXTURE_2D,GL_REPEAT,GL_REPEAT,GL_NEAREST,GL_NEAREST); float borderColor[] = { 1.0, 1.0, 1.0, 1.0 }; - glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); + glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); // Create frame buffer glGenFramebuffers(1, &id); @@ -43,8 +43,10 @@ namespace cgp{ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, texture.id, 0); // No color buffer is used in depth mode + #ifndef __EMSCRIPTEN__ glDrawBuffer(GL_NONE); glReadBuffer(GL_NONE); + #endif } // Reset the standard framebuffer to output on the screen diff --git a/library/cgp/opengl_include.hpp b/library/cgp/opengl_include.hpp index e33acc3..64a7fab 100644 --- a/library/cgp/opengl_include.hpp +++ b/library/cgp/opengl_include.hpp @@ -49,7 +49,7 @@ // Special case for EMScripten (don't rely on glad) #ifdef __EMSCRIPTEN__ #include -#include // OpenGL ES 3 +#include // OpenGL ES 3 #endif