Rendering VTK in external OpenGL context with single buffering

Hi All!

I want to render a circle (to start off slow) using VTK in an existing application. We use GLFW to create a window and the OpenGL context as well as GLAD for the bindings. I presume that vtkExternalOpenGLRenderWindow would be the tool to use in this case.

After some successful experiments I found a problem I cannot solve: Our application uses single buffering (hard requirement) and additionally we want to render VTK into a FBO, for a later use/composition. The problem I ran into is that the circle is rendered but VTK attempts to bind GL_BACK_LEFT to the DrawBuffer and ReadBuffer, which does not exist in our context and the debug callback reports it as an error. I am concerned about stability implications of our application under these circumstances, and I wonder if there is a better way to embed VTK into a pre-existing single-buffer OpenGL context.

Any help is much appreciated!

You should be able to disable double buffering using vtkWindow::SetDoubleBuffer. By default, this is enabled by vtkRenderWindow.

Thanks @sankhesh for your tip! Unfortunately, I already use this flag with no affect. When looking into the source code I can see, that the DoubleBuffer flag is not used to check if the buffers are there in the initialization of the vtkOpenGLState object.

Could it be that this is a bug?