]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/occludedscene.h
Use constructor delegation instead of init functions when possible
[libs/gl.git] / source / render / occludedscene.h
index 9140d13b62624b56ab1ce7e5f022f691df4a2302..d51b29b36c87def2ef0ed1e7c30544a0aabea148 100644 (file)
@@ -3,13 +3,17 @@
 
 #include <set>
 #include <vector>
-#include "mesh.h"
-#include "program.h"
+#include "blend.h"
+#include "depthtest.h"
+#include "query.h"
 #include "scene.h"
 
 namespace Msp {
 namespace GL {
 
+class Mesh;
+class Program;
+
 /**
 A scene that performs occlusion queries on renderables to skip those that are
 entirely occluded by others.
@@ -26,24 +30,22 @@ private:
                const Geometry::BoundingSphere<float, 3> *bounding_sphere;
                bool in_frustum;
                bool occluder;
-               unsigned query;
 
                OccludedRenderable();
        };
 
-       typedef std::set<Renderable *> RenderableSet;
-       typedef std::vector<OccludedRenderable> OccludedArray;
-
        const Mesh &bounding_mesh;
        const Program &bounding_shader;
-       RenderableSet renderables;
+       Blend no_color_write;
+       DepthTest no_depth_write;
+       std::set<Renderable *> renderables;
        float occluder_min_size;
-       mutable OccludedArray occluded_cache;
+       mutable QueryPool queries;
+       mutable std::vector<OccludedRenderable> occluded_cache;
        mutable bool cache_dirty;
 
 public:
        OccludedScene();
-       ~OccludedScene();
 
        virtual void add(Renderable &);
        virtual void remove(Renderable &);