-
Hello, I've been trying to port my app written in C++ to a web app with emscripten and so far so good but now I came to an halt because I can't figure out a way how to compile the code with framebuffer objects. I need to use During compilation I get:
for all mentioned functions. I made sure I imported headers with: #include <GL/gl.h>
#include <emscripten.h>
#include <GLFW/glfw3.h> I'm using cmake so my emscripten-related stuff in CMakeLists.txt looks like this: ...
set(LFLAGS "-s USE_GLFW=3 -s OFFSCREEN_FRAMEBUFFER=1")
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "${LFLAGS}")
... Am I doing something wrong or emscripten doesn't support FBOs? From https://emscripten.org/docs/tools_reference/settings_reference.html#offscreen-framebuffer it seems like it does so what's the mistake here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It looks like you you using the old desktop GL headers. This means you are likely looks for GL desktop emulation as described here: https://emscripten.org/docs/porting/multimedia_and_graphics/OpenGL-support.html#emulation-of-older-desktop-opengl-api-features. However desktop GL 1.0 doesn't appear to support |
Beta Was this translation helpful? Give feedback.
It looks like you you using the old desktop GL headers. This means you are likely looks for GL desktop emulation as described here: https://emscripten.org/docs/porting/multimedia_and_graphics/OpenGL-support.html#emulation-of-older-desktop-opengl-api-features.
However desktop GL 1.0 doesn't appear to support
glGenFramebuffers
. That looks like it was added in GL 3 or 4 which emscripten does not support emulation of. However we do support emulating GLES2 which does have that function. For that you want to use theGLES2/gl2.h
header.