trlsmax / imgui-vtk

test on how to integrate vtk into glfw + imgui project
MIT License
107 stars 26 forks source link

Minimising and then maximising window blanks screen #15

Open pavanakumar opened 1 year ago

pavanakumar commented 1 year ago

I found that when I tried to minimise the VTK window and then maximise it the contents of the VTK viewer the complete window goes blank and I get an error message from VTK.

prob1 prob2 prob3

  0 : (1286) Invalid framebuffer operation with stack trace of
0x117634668 : vtksys::SystemInformationImplementation::GetProgramStack(int, int) [(libvtksys-9.2.9.2.2.dylib) ???:-1]
0x1176345f0 : vtksys::SystemInformation::GetProgramStack(int, int) [(libvtksys-9.2.9.2.2.dylib) ???:-1]
0x102a13460 : (anonymous namespace)::reportOpenGLErrors(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x102a16a30 : vtkOpenGLState::SetEnumState(unsigned int, bool) [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x102860e14 : vtkOpenGLState::ScopedglEnableDisable::~ScopedglEnableDisable() [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x10285fce0 : vtkOpenGLState::ScopedglEnableDisable::~ScopedglEnableDisable() [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x102a19644 : vtkOpenGLState::vtkglBlitFramebuffer(int, int, int, int, int, int, int, int, unsigned int, unsigned int) [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x1029da240 : vtkOpenGLRenderWindow::Frame() [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x1028c3130 : vtkGenericOpenGLRenderWindow::Frame() [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x103394d74 : vtkRenderWindow::CopyResultFrame() [(libvtkRenderingCore-9.2.9.2.2.dylib) ???:-1]
0x103393b4c : vtkRenderWindow::Render() [(libvtkRenderingCore-9.2.9.2.2.dylib) ???:-1]
0x1029de9a4 : vtkOpenGLRenderWindow::Render() [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x1028c37d0 : vtkGenericOpenGLRenderWindow::Render() [(libvtkRenderingOpenGL2-9.2.9.2.2.dylib) ???:-1]
0x10233d428 : VtkViewer::render(ImVec2) [(imgui_vtk) ???:-1]
0x10233d3cc : VtkViewer::render() [(imgui_vtk) ???:-1]
0x102246e64 : main [(imgui_vtk) ???:-1]
0x19ae41430 : start [(libdyld.dylib) ???:-1]

Currently I have disabled the window minimisation to prevent this from happening in my code. Am using VTK 9.0 and running MacOs Big Sur 11.7 on an Apple M1.

triuk commented 1 year ago

Probably a platform issue. It does not happen on Linux. Did you just download and run the example without any change? Can you try on other Mac device maybe with the newest 13 Ventura?

pavanakumar commented 1 year ago

The posted example uses glad instead of gl3w. But the issue persists in both cases on my Mac. I tried this on Linux and this works for me as well (I do not have access to Ventura yet).

For now I am disabling minimisation on Mac.

rajkundu commented 1 year ago

This is odd. I tried minimizing on my own Mac (16" Intel MacBook Pro, macOS 12.5), and it works fine. I'm really not sure what could be causing it. If you come across any more information or have any ideas in the future, please update us here!