I took inspiration from the VTK GLUT example. Basically, I managed to add:
// Initialize GLFW.
glfwInit();
GLFWwindow * window = glfwCreateWindow(800, 600, "window", NULL, NULL);
if (!window) {
std::cerr << "Error: can't create OpenGL window" << std::endl;
return 1;
}
glfwMakeContextCurrent(window);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
And
// Terminate GLFW.
glfwTerminate();
Before and after the creation of the VTK pipeline
Unfortunately, I still get the same crash in glGenFramebuffers
under vtkOpenGLFramebufferObject::CreateFBO
?!.. @Jens_Munk_Hansen: any clue?