]> git.mxchange.org Git - simgear.git/blob - simgear/scene/material/EffectCullVisitor.hxx
Add positioned uniforms and G-buffer textures to Effects
[simgear.git] / simgear / scene / material / EffectCullVisitor.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_EFFECT_CULL_VISITOR_HXX
18 #define SIMGEAR_EFFECT_CULL_VISITOR_HXX 1
19
20 #include <osgUtil/CullVisitor>
21
22 #include <map>
23
24 namespace osg
25 {
26 class Geode;
27 class Texture2D;
28 }
29
30 namespace simgear
31 {
32 class EffectCullVisitor : public osgUtil::CullVisitor
33 {
34 public:
35     EffectCullVisitor();
36     EffectCullVisitor(const EffectCullVisitor&);
37     virtual osgUtil::CullVisitor* clone() const;
38     using osgUtil::CullVisitor::apply;
39     virtual void apply(osg::Geode& node);
40
41     void clearBufferList();
42     void addBuffer(int i, osg::Texture2D* tex);
43     osg::Texture2D* getBuffer(int i);
44
45 private:
46     std::map<int,osg::ref_ptr<osg::Texture2D> > _bufferList;
47 };
48 }
49 #endif