Improve fine-tuning of OpenGL/Mesa RenderWindow
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Right now, there is no way for a user to force the creation of the default OpenGL framebuffer [1] of an OpenGL renderer window with a particular set of criteria (number of bits in the depth buffer, in the color buffer, ...)
It could be done by adding some preference profile object. For example, this profile could have a minimum number of bits for a depth buffer, a minimum number of bits for the colorbuffer. In parallel, each item of the preference list should have a boolean value saying if the item is required or if it is up to the system to pick any.
For the illustration purpose of the discussion, let's call vtkFrameBufferProfile a class composed of two pointers. The first one to a vtkFrameBufferProfileValues object and the second one to a vtkFrameBufferProfileMask object.
class vtkFrameBufferProfile { public: vtkFrameBufferProfileValues *GetValues(); vtkFrameBufferProfileMask *GetMask(); }
For example, with:
vtkFrameBufferProfile *p=vtkFrameBufferProfile::New(); p->GetValues()->SetDepthBufferBits(24); p->GetMask()->SetDepthBufferBits(true); p->GetMask()->SetColorBufferBits(false);
the user is asking for a minimum of 24 bits in the depth buffer but does not care about how many bits are used for the colorbuffer. The system will create a framebuffer with at least 24bits in its depth buffer and with any kind of colorbuffer, regardless of the colorbufferbits preference value.
To build the list of preferences, we can use references [2],[3] and [4].
[1] "default" framebuffer, as defined in the OpenGL 3.2 Compatibility Profile Specification, section 2.1, page 6 as the window system-provided framebuffer http://www.opengl.org/registry/doc/glspec32.compatibility.20091207.pdf [2] GLX 1.4 http://www.opengl.org/documentation/specs/glx/glx1.4.pdf [3] WGL pixel format: http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt [4] NSOpenGLPixelFormat: Mac OS X http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOpenGLPixelFormat_Class/Reference/Reference.html