OpenSceneGraph/include/osgUtil/VisualsRequirementsVisitor

54 lines
1.6 KiB
Plaintext
Raw Normal View History

//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.
2001-09-20 05:19:47 +08:00
#ifndef OSGUTIL_VISUALSREQUIREMENTSVISITOR
#define OSGUTIL_VISUALSREQUIREMENTSVISITOR 1
#include <osg/NodeVisitor>
#include <osg/Geode>
#include <osg/VisualsSettings>
2001-09-20 05:19:47 +08:00
#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
2001-09-28 20:36:40 +08:00
* applications to set up there windows with the correct visuals. Have a look at
2001-09-20 05:19:47 +08:00
* src/osgGLUT/Viewer.cpp's Viewer::open() method for an example how to use it.
*/
class OSGUTIL_EXPORT VisualsRequirementsVisitor : public osg::NodeVisitor
{
public:
/** Default to traversing all children, and reqiresDoubleBuffer,
* requiresRGB and requiresDepthBuffer to true and with
* alpha and stencil off.*/
VisualsRequirementsVisitor();
/** Set the VisualsSettings. */
inline void setVisualsSettings(osg::VisualsSettings* vs) { _vs = vs; }
/** Get the VisualsSettings */
inline const osg::VisualsSettings* getVisualsSettings() const { return _vs.get(); }
2001-09-20 05:19:47 +08:00
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::VisualsSettings> _vs;
2001-09-20 05:19:47 +08:00
};
};
#endif