Changing global display settings
OSG manages a set of global display settings that are required by cameras, viewers, and other scene elements. It uses the singleton pattern to declare a unique instance of the container of all of these settings, by using the osg::DisplaySettings
class. We can thus obtain the display settings instance at any time in our applications:
osg::DisplaySettings* ds = osg::DisplaySettings::instance();
The osg::DisplaySettings
instance sets up properties requested by all newly created rendering devices, mainly OpenGL graphics contexts of rendering windows. Its characteristics include:
- Set double or single buffering with the
setDoubleBuffer()
method. The default is on. - Set whether to use the depth buffer or not, via the
setDepthBuffer() ...
Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.