]> git.mxchange.org Git - simgear.git/blob - simgear/scene/material/EffectCullVisitor.hxx
Random buildings - initial commit.
[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 EffectGeode;
33 class EffectCullVisitor : public osgUtil::CullVisitor
34 {
35 public:
36     EffectCullVisitor(bool collectLights = false);
37     EffectCullVisitor(const EffectCullVisitor&);
38     virtual osgUtil::CullVisitor* clone() const;
39     using osgUtil::CullVisitor::apply;
40     virtual void apply(osg::Geode& node);
41     virtual void reset();
42
43     void clearBufferList();
44     void addBuffer(int i, osg::Texture2D* tex);
45     osg::Texture2D* getBuffer(int i);
46
47 private:
48     std::map<int,osg::ref_ptr<osg::Texture2D> > _bufferList;
49     std::vector<osg::ref_ptr<EffectGeode> > _lightList;
50     bool _collectLights;
51 };
52 }
53 #endif