build VTK-9.1.0 to webassembly

Nice to update to VTK-9.1.0 on Windows11 .

But when I compile it via dockcross/web-wasm:20220202, it raise error like below :wink:

/VTK-9.1.0/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx:142:21: error: use of undeclared identifier ‘GL_DRAW_BUFFER’
glGetIntegerv(GL_DRAW_BUFFER, &savedDrawBuffer);

the cmake command is :
…/…/apps/VTK-9.1.0 && cmake --build .

sometimes I use ninja -j 16 and the error is the same.

Any reply will be very appreciated ! Thanks in advance!

I think we just haven’t used the context toolkit in webasm yet. It probably needs to be ifdef’d out and when ifdef’d out always assume GL_BACK_LEFT

e.g. something like

    GLint attachment = GL_BACK_LEFT;
    glGetIntegerv(GL_DRAW_BUFFER, &attachment);


1 Like

Many Thanks !
I have resolved this by set OPENGL=DONT_WANT . :slight_smile:

Could you show me how to add OPENGL=DONT_WANT ?
I add -DVTK_MODULE_ENABLE_VTK_opengl:STRING=DONT_WANT , but still has the same error.


@Sebastien_Jourdain I used ccmake and set OPENGL_GLES2_INCLUDE_DIR and OPENGL_GLES3_INCLUDE_DIR with a absolute path


but still has the error.

:cold_sweat: I’m sorry that, because new users are temporarily limited to 3 replies in the same topic. So I edit this to reply you.

Use ccmake to prevent guess work on the command line.

I’m new in VTK and webassembly. Can you show me the detail configration of cmake ? :cold_sweat: