1 // Copyright (C) 2008 Timothy Moore timoore@redhat.com
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License as
5 // published by the Free Software Foundation; either version 2 of the
6 // License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #ifndef SIMGEAR_PASS_HXX
18 #define SIMGEAR_PASS_HXX 1
20 #include <osg/ref_ptr>
21 #include <osg/StateSet>
26 class Pass : public osg::StateSet
29 typedef std::list<std::pair<int,std::string> > BufferUnitList;
30 typedef std::map<std::string,osg::Vec4> PositionedUniformMap;
32 META_Object(simgear,Pass);
35 const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
37 void setBufferUnit( int unit, std::string buffer ) { _bufferUnitList.push_back( std::make_pair(unit,buffer) ); }
38 const BufferUnitList& getBufferUnitList() const { return _bufferUnitList; }
40 void addPositionedUniform( const std::string& name, const osg::Vec4& offset ) { _positionedUniforms[name] = offset; }
41 const PositionedUniformMap& getPositionedUniformMap() const { return _positionedUniforms; }
44 BufferUnitList _bufferUnitList;
45 PositionedUniformMap _positionedUniforms;