How to proper render into PixMap?

The `V3d_View` class has a `ToPixMap` method that renders the view into the specified image buffer.
But is it possible to use this function without attaching any `Aspect_Window` to the view?

I just created a new `V3d_View`, set up its camera, and called `ToPixMap`. It fails inside the function because it cannot create an FBO without a window.

What am I missing?

gkv311 n's picture

OpenGl_View cannot be initialized (create OpenGL context) without providing a native window (OpenGl_View::SetWindow() called by V3d_View::SetWindow()). Although some systems might provide window-less OpenGL context, this workflow is not the way to use V3d_View.

However, this shouldn't be a problem in most cases - just create a window without mapping it onto the screen, and you'll be able to generate offscreen images. This approach is described in this article and you may find a code sample on GitHub.