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.
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.
So I would try to set it (using the wrapping set function SetDoubleBuffer() ) just after my smartPointer allocation of the vtkRenderWindow object that should call this constructor ?
I actually never got it to run. I went for a rather hacky solution where I use an offscreen context, without error propagation, besides my main context.
I tried to look into the code again today, but i couldn’t wrap my head around it again in a meaningful time. I will check my version again and upgrade if possible. Will keep you posted.
No as using double buffering does not cause me issues and allows for faster fps at this time, but using opengl acceleration too, I was just interested by this issue.