Files
OpenSceneGraph/include/osgUtil/RenderStageLighting
Robert Osfield f36bc69c58 Made the more of the OSG's referenced object desctructors protected to ensure
that they arn't created on the stack inappropriately.

Split the implemention of Matrix up so that it is a simple no referenced counted
class and can be safefly created on the stack.  To support referenced counting a
seperate subclass now exists, this is RefMatrix which inherits from both Matrix and
Object.
2003-01-10 09:25:42 +00:00

58 lines
1.7 KiB
Plaintext

//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef OSGUTIL_RENDERSTAGELIGHTING
#define OSGUTIL_RENDERSTAGELIGHTING 1
#include <osg/Object>
#include <osg/Light>
#include <osg/State>
#include <osgUtil/RenderLeaf>
#include <osgUtil/RenderGraph>
namespace osgUtil {
/**
* RenderBin base class.
*/
class OSGUTIL_EXPORT RenderStageLighting : public osg::Object
{
public:
RenderStageLighting();
virtual osg::Object* cloneType() const { return new RenderStageLighting(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStageLighting(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderStageLighting*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "RenderStageLighting"; }
virtual void reset();
typedef std::pair< const osg::StateAttribute*, osg::ref_ptr<osg::RefMatrix> > AttrMatrixPair;
typedef std::vector< AttrMatrixPair > AttrMatrixList;
virtual void addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr)
{
_attrList.push_back(AttrMatrixPair(attr,matrix));
}
virtual void draw(osg::State& state,RenderLeaf*& previous);
public:
AttrMatrixList _attrList;
protected:
virtual ~RenderStageLighting();
};
}
#endif