Segfaults most likely because the opengl function pointers are all null. Have you tried calling renderWindow_->vtkOpenGLRenderWindow::OpenGLInit() instead?
Do you really need to use a vtkGenericOpenGLRenderWindow? That class is generally used by applications that have already setup a win32/x/cocoa window. Did you do that?
My app uses vtk to render a surface within Qt, in a QQuickItem. The app was written several years ago, worked with Qt5 and VTK-9.2 using vtkGenericOpenGLRenderWindow, I assume because Qt sets up OpenGL beforehand… Now segfaults with Qt6 and VTK-9.3.
Gosh I cannot for the life of me figure out how to use QQuickVTKItem from the unit tests. Documentation for QQuickVTKRenderItem has a nice clear example - yet when I try to build that simple app the compiler gives warning: ‘QQuickVTKRenderWindow’ is deprecated: Use QQuickVTKItem instead
But documentation for QQuickVTKItem has no such example - and I’m afraid I’m just not grokking the unit tests. Any clues appreciated!
Thanks!
% ctest -R VTK::GUISupportQtQuickCxx-TestQQuickVTKItem_1 -VV
UpdateCTestConfiguration from :/home/oreilly/VTK-9.3.1/build/DartConfiguration.
tcl
Parse Config file:/home/oreilly/VTK-9.3.1/build/DartConfiguration.tcl
Add coverage exclude regular expressions.
Add coverage exclude: vtk[^\.]+(Java|Python).cxx
Add coverage exclude: .*Testing.Cxx.*cxx
Add coverage exclude: .*Testing.Cxx.*h
Add coverage exclude: .*moc_.*cxx
Add coverage exclude: .*/Utilities/.*
Add coverage exclude: .*/ThirdParty/.*
UpdateCTestConfiguration from :/home/oreilly/VTK-9.3.1/build/DartConfiguration.tcl
Parse Config file:/home/oreilly/VTK-9.3.1/build/DartConfiguration.tcl
Test project /home/oreilly/VTK-9.3.1/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 502
Start 502: VTK::GUISupportQtQuickCxx-TestQQuickVTKItem_1
502: Test command: /home/oreilly/VTK-9.3.1/build/bin/vtkGUISupportQtQuickCxxTests "TestQQuickVTKItem_1" "-D" "/home/oreilly/VTK-9.3.1/build/ExternalData/Testing" "-T" "/home/oreilly/VTK-9.3.1/build/Testing/Temporary" "-V" "/home/oreilly/VTK-9.3.1/build/ExternalData/GUISupport/QtQuick/Testing/Data/Baseline/TestQQuickVTKItem_1.png"
502: Working Directory: /home/oreilly/VTK-9.3.1/build/GUISupport/QtQuick/Testing/Cxx
502: Test timeout computed to be: 1500
502: CTEST_FULL_OUTPUT (Avoid ctest truncation of output)
502: ESC[0mESC[31m( 1.898s) [main thread ]vtkOpenGLRenderWindow.c:701 ERR| vtkGenericOpenGLRenderWindow (0x55d34121fff0): GLEW could not be initialized: Unknown errorESC[0m
502: ESC[0mESC[31m( 1.902s) [main thread ]vtkOpenGLRenderWindow.c:701 ERR| vtkGenericOpenGLRenderWindow (0x55d34121fff0): GLEW could not be initialized: Unknown errorESC[0m
502: <DartMeasurement name="ImageError" type="numeric/double">0</DartMeasurement><DartMeasurement name="BaselineImage" type="text/string">Standard</DartMeasurement>
1/1 Test #502: VTK::GUISupportQtQuickCxx-TestQQuickVTKItem_1 ...***Failed Error regular expression found in output. Regex=[ERR\|] 3.07 sec
0% tests passed, 1 tests failed out of 1
Label Time Summary:
VTK::GUISupportQtQuick = 3.07 sec*proc (1 test)
Total Test time (real) = 3.23 sec
The following tests FAILED:
502 - VTK::GUISupportQtQuickCxx-TestQQuickVTKItem_1 (Failed)
Errors while running CTest
Output from these tests are in: /home/oreilly/VTK-9.3.1/build/Testing/Temporary/LastTest.log
The test exits immediately, so you might not see anything. Instead, you can run the unit test interactively with the “-I” flag. This flag is parsed by the C++ test, it is not a ctest option.