OpenSceneGraph/include/osgUtil/DisplayRequirementsVisitor
Robert Osfield 19c99dc94c Further work on improving stereo support in the OSG.
Renamed the osg::VisualsSettings to osg::DisplaySettings, and
osgUtil::VisualsRequirementsVisitor to osgUtil::DisplayRequirementsVisitor.

Added support for OSG_SCREEN_HEIGHT into osg::DisplaySettings, and added
a DisplaySettings* to the constructors of osg::SceneView and osg::Camera.
2001-12-21 22:48:19 +00:00

54 lines
1.6 KiB
Plaintext

//C++ header - Open Scene Graph - Copyright (C) 1998-2001 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef OSGUTIL_DISPLAYEQUIREMENTSVISITOR
#define OSGUTIL_DISPLAYREQUIREMENTSVISITOR 1
#include <osg/NodeVisitor>
#include <osg/Geode>
#include <osg/DisplaySettings>
#include <osgUtil/Export>
namespace osgUtil {
/** A visitor for traversing a scene graph establishing the OpenGL visuals are required
* to support rendering of that scene graph. The results can then be used by
* applications to set up there windows with the correct visuals. Have a look at
* src/osgGLUT/Viewer.cpp's Viewer::open() method for an example how to use it.
*/
class OSGUTIL_EXPORT DisplayRequirementsVisitor : public osg::NodeVisitor
{
public:
/** Default to traversing all children, and reqiresDoubleBuffer,
* requiresRGB and requiresDepthBuffer to true and with
* alpha and stencil off.*/
DisplayRequirementsVisitor();
/** Set the DisplaySettings. */
inline void setDisplaySettings(osg::DisplaySettings* ds) { _ds = ds; }
/** Get the DisplaySettings */
inline const osg::DisplaySettings* getDisplaySettings() const { return _ds.get(); }
virtual void applyStateSet(osg::StateSet& stateset);
virtual void apply(osg::Node& node);
virtual void apply(osg::Geode& geode);
virtual void apply(osg::Impostor& impostor);
protected:
osg::ref_ptr<osg::DisplaySettings> _ds;
};
};
#endif