2001-10-04 23:12:57 +08:00
|
|
|
//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-12-22 06:48:19 +08:00
|
|
|
#ifndef OSGUTIL_DISPLAYEQUIREMENTSVISITOR
|
|
|
|
#define OSGUTIL_DISPLAYREQUIREMENTSVISITOR 1
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
#include <osg/NodeVisitor>
|
|
|
|
#include <osg/Geode>
|
2001-12-22 06:48:19 +08:00
|
|
|
#include <osg/DisplaySettings>
|
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.
|
|
|
|
*/
|
2001-12-22 06:48:19 +08:00
|
|
|
class OSGUTIL_EXPORT DisplayRequirementsVisitor : public osg::NodeVisitor
|
2001-09-20 05:19:47 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
/** Default to traversing all children, and reqiresDoubleBuffer,
|
|
|
|
* requiresRGB and requiresDepthBuffer to true and with
|
|
|
|
* alpha and stencil off.*/
|
2001-12-22 06:48:19 +08:00
|
|
|
DisplayRequirementsVisitor();
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
|
2001-12-22 06:48:19 +08:00
|
|
|
/** Set the DisplaySettings. */
|
|
|
|
inline void setDisplaySettings(osg::DisplaySettings* ds) { _ds = ds; }
|
2001-12-19 08:38:23 +08:00
|
|
|
|
2001-12-22 06:48:19 +08:00
|
|
|
/** Get the DisplaySettings */
|
|
|
|
inline const osg::DisplaySettings* getDisplaySettings() const { return _ds.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:
|
|
|
|
|
2001-12-22 06:48:19 +08:00
|
|
|
osg::ref_ptr<osg::DisplaySettings> _ds;
|
2001-12-19 08:38:23 +08:00
|
|
|
|
2001-09-20 05:19:47 +08:00
|
|
|
};
|
|
|
|
|
2002-02-03 20:33:41 +08:00
|
|
|
}
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
#endif
|