]> git.mxchange.org Git - flightgear.git/blobdiff - src/Viewer/renderingpipeline.hxx
Rely entirely on the configurable renderer and add more configuration options in...
[flightgear.git] / src / Viewer / renderingpipeline.hxx
index 875294faf71e1062787861fe75044b4ec0612a46..9f165bd15b303ebdc9a9899f625bcf5bfc1c9f83 100644 (file)
@@ -3,8 +3,11 @@
 #define __FG_RENDERINGPIPELINE_HXX 1
 
 #include <osg/ref_ptr>
+#include <osg/Camera>
 #include <string>
 
+#include <simgear/structure/SGExpression.hxx>
+
 namespace simgear
 {
 class SGReaderWriterOptions;
@@ -23,7 +26,19 @@ namespace flightgear {
 
 class FGRenderingPipeline : public osg::Referenced {
 public:
-    struct Buffer : public osg::Referenced {
+    class Conditionable : public osg::Referenced {
+    public:
+        Conditionable() : _alwaysValid(true) {}
+        void parseCondition(SGPropertyNode* prop);
+        bool getAlwaysValid() const { return _alwaysValid; }
+        void setAlwaysValid(bool val) { _alwaysValid = val; }
+        void setValidExpression(SGExpressionb* exp);
+        bool valid();
+    protected:
+        bool _alwaysValid;
+        SGSharedPtr<SGExpressionb> _validExpression;
+    };
+    struct Buffer : public Conditionable {
         Buffer(SGPropertyNode* prop);
 
         std::string name;
@@ -39,52 +54,49 @@ public:
                //osg::Vec4 borderColor;
     };
 
-    struct Pass : public osg::Referenced {
+    struct Pass : public Conditionable {
         Pass(SGPropertyNode* prop);
 
         std::string name;
         std::string type;
+        int orderNum;
+        std::string effect;
+    };
+
+    struct Attachment : public Conditionable {
+        Attachment(SGPropertyNode* prop);
+        Attachment(osg::Camera::BufferComponent c, const std::string& b ) : component(c), buffer(b) {}
+
+        osg::Camera::BufferComponent component;
+        std::string buffer;
     };
+    typedef std::vector<osg::ref_ptr<Attachment> > AttachmentList;
 
-    struct Stage : public osg::Referenced {
+    struct Stage : public Pass {
         Stage(SGPropertyNode* prop);
 
-        std::string name;
-        std::string type;
+        bool needsDuDv;
+        float scaleFactor;
 
         std::vector<osg::ref_ptr<Pass> > passes;
+        AttachmentList attachments;
     };
     FGRenderingPipeline();
 
-    flightgear::CameraInfo* buildCamera(flightgear::CameraGroup* cgroup,
-                                        unsigned flags,
-                                        osg::Camera* camera,
-                                        const osg::Matrix& view,
-                                        const osg::Matrix& projection,
-                                        osg::GraphicsContext* gc);
-
-private:
     std::vector<osg::ref_ptr<Buffer> > buffers;
     std::vector<osg::ref_ptr<Stage> > stages;
 
-    void buildBuffers(flightgear::CameraInfo* info);
-    void buildStage(flightgear::CameraInfo* info,
-                    Stage* stage,
-                    flightgear::CameraGroup* cgroup,
-                    osg::Camera* camera,
-                    const osg::Matrix& view,
-                    const osg::Matrix& projection,
-                    osg::GraphicsContext* gc);
-    void buildMainCamera(flightgear::CameraInfo* info,
-                    Stage* stage,
-                    flightgear::CameraGroup* cgroup,
-                    osg::Camera* camera,
-                    const osg::Matrix& view,
-                    const osg::Matrix& projection,
-                    osg::GraphicsContext* gc);
-
     friend FGRenderingPipeline* flightgear::makeRenderingPipeline(const std::string& name,
                    const simgear::SGReaderWriterOptions* options);
 };
 
+namespace flightgear {
+
+class PipelinePredParser : public simgear::expression::ExpressionParser
+{
+public:
+protected:
+};
+}
+
 #endif