]> git.mxchange.org Git - flightgear.git/blobdiff - src/Viewer/renderer.hxx
VoiceSynthesizer: add some test/debug properties
[flightgear.git] / src / Viewer / renderer.hxx
index e870fb1219951b76b5da561eda25cf4df0165596..6f560672491b4ddadf2b9bf2364e830d0ebe327d 100644 (file)
@@ -42,6 +42,7 @@ class CameraGroup;
 }
 
 class SGSky;
+class SGUpdateVisitor;
 
 class FGRenderer {
 
@@ -61,8 +62,7 @@ public:
   
     /** Just pick into the scene and return the pick callbacks on the way ...
      */
-    bool pick( std::vector<SGSceneryPick>& pickList,
-               const osgGA::GUIEventAdapter* ea );
+    bool pick( std::vector<SGSceneryPick>& pickList, const osg::Vec2& windowPos);
 
     /** Get and set the OSG Viewer object, if any.
      */
@@ -121,8 +121,17 @@ public:
 protected:
     osg::ref_ptr<osgViewer::Viewer> viewer;
     osg::ref_ptr<flightgear::FGEventHandler> eventHandler;
-    SGPropertyNode_ptr _scenery_loaded,_scenery_override;
-    SGPropertyNode_ptr _skyblend, _splash_alpha;
+    
+    osg::ref_ptr<osg::FrameStamp> _frameStamp;
+    osg::ref_ptr<SGUpdateVisitor> _updateVisitor;
+    osg::ref_ptr<osg::Group> _viewerSceneRoot;
+    osg::ref_ptr<osg::Group> _deferredRealRoot;
+    osg::ref_ptr<osg::Group> _root;
+    
+    SGPropertyNode_ptr _scenery_loaded, _position_finalized;
+    
+    
+    SGPropertyNode_ptr _splash_alpha;
     SGPropertyNode_ptr _point_sprites, _enhanced_lighting, _distance_attenuation;
     SGPropertyNode_ptr _textures;
     SGPropertyNode_ptr _cloud_status, _visibility_m; 
@@ -138,22 +147,24 @@ protected:
     float _cascadeFar[4];
     bool _useColorForDepth;
 
+    typedef std::vector<SGPropertyChangeListener*> SGPropertyChangeListenerVec;
+    SGPropertyChangeListenerVec _listeners;
+    
     flightgear::CameraInfo* buildCameraFromRenderingPipeline(FGRenderingPipeline* rpipe, flightgear::CameraGroup* cgroup, unsigned flags, osg::Camera* camera,
                                         const osg::Matrix& view, const osg::Matrix& projection, osg::GraphicsContext* gc);
 
     void buildBuffers(FGRenderingPipeline* rpipe, flightgear::CameraInfo* info);
-    void buildStage(flightgear::CameraInfo* info, FGRenderingPipeline::Stage* stage, flightgear::CameraGroup* cgroup, osg::Camera* mainCamera, osg::GraphicsContext* gc);
+    void buildStage(flightgear::CameraInfo* info, FGRenderingPipeline::Stage* stage, flightgear::CameraGroup* cgroup, osg::Camera* mainCamera, const osg::Matrix& view, const osg::Matrix& projection, osg::GraphicsContext* gc);
     osg::Node* buildPass(flightgear::CameraInfo* info, FGRenderingPipeline::Pass* pass);
     osg::Node* buildLightingSkyCloudsPass(FGRenderingPipeline::Pass* pass);
     osg::Node* buildLightingLightsPass(flightgear::CameraInfo* info, FGRenderingPipeline::Pass* pass);
 
     osg::Camera* buildDeferredGeometryCamera( flightgear::CameraInfo* info, osg::GraphicsContext* gc, const std::string& name, const FGRenderingPipeline::AttachmentList& attachments );
     osg::Camera* buildDeferredShadowCamera( flightgear::CameraInfo* info, osg::GraphicsContext* gc, const std::string& name, const FGRenderingPipeline::AttachmentList& attachments );
-    osg::Camera* buildDeferredLightingCamera( flightgear::CameraInfo* info, osg::GraphicsContext* gc, const std::string& name, const FGRenderingPipeline::AttachmentList& attachments );
     osg::Camera* buildDeferredLightingCamera( flightgear::CameraInfo* info, osg::GraphicsContext* gc, const FGRenderingPipeline::Stage* stage );
     osg::Camera* buildDeferredFullscreenCamera( flightgear::CameraInfo* info, osg::GraphicsContext* gc, const FGRenderingPipeline::Stage* stage );
     osg::Camera* buildDeferredFullscreenCamera( flightgear::CameraInfo* info, const FGRenderingPipeline::Pass* pass );
-    void buildDeferredDisplayCamera( osg::Camera* camera, flightgear::CameraInfo* info, const std::string& name, osg::GraphicsContext* gc );
+    void buildDeferredDisplayCamera( osg::Camera* camera, flightgear::CameraInfo* info, const FGRenderingPipeline::Stage* stage, osg::GraphicsContext* gc );
 
     void updateShadowCascade(const flightgear::CameraInfo* info, osg::Camera* camera, osg::Group* grp, int idx, double left, double right, double bottom, double top, double zNear, double f1, double f2);
     osg::Vec3 getSunDirection() const;
@@ -169,6 +180,12 @@ protected:
     osg::ref_ptr<osg::Uniform> _depthInColor;
 
     osg::ref_ptr<FGRenderingPipeline> _pipeline;
+    
+    void addChangeListener(SGPropertyChangeListener* l, const char* path);
+    
+    void updateSky();
+  
+    void setupRoot();
 };
 
 bool fgDumpSceneGraphToFile(const char* filename);