]> git.mxchange.org Git - simgear.git/blob - simgear/scene/material/Pass.hxx
Random buildings - initial commit.
[simgear.git] / simgear / scene / material / Pass.hxx
1 // Copyright (C) 2008  Timothy Moore timoore@redhat.com
2 //
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.
7 //
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.
12 //
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.
16
17 #ifndef SIMGEAR_PASS_HXX
18 #define SIMGEAR_PASS_HXX 1
19
20 #include <osg/ref_ptr>
21 #include <osg/StateSet>
22
23 namespace simgear
24 {
25
26 class Pass : public osg::StateSet
27 {
28 public:
29     typedef std::list<std::pair<int,int> > BufferUnitList;
30     typedef std::map<std::string,osg::Vec4> PositionedUniformMap;
31
32     META_Object(simgear,Pass);
33     Pass() {}
34     Pass(const Pass& rhs,
35          const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
36
37     void setBufferUnit( int unit, int buffer ) { _bufferUnitList.push_back( std::make_pair(unit,buffer) ); }
38     const BufferUnitList& getBufferUnitList() const { return _bufferUnitList; }
39
40     void addPositionedUniform( const std::string& name, const osg::Vec4& offset ) { _positionedUniforms[name] = offset; }
41     const PositionedUniformMap& getPositionedUniformMap() const { return _positionedUniforms; }
42
43 private:
44     BufferUnitList _bufferUnitList;
45     PositionedUniformMap _positionedUniforms;
46 };
47
48 }
49
50 #endif