2 #ifndef __FG_RENDERER_HXX
3 #define __FG_RENDERER_HXX 1
5 #include <simgear/scene/util/SGPickCallback.hxx>
6 #include <simgear/props/props.hxx>
7 #include <simgear/timing/timestamp.hxx>
20 class GUIEventAdapter;
54 void resize(int width, int height );
58 /** Just pick into the scene and return the pick callbacks on the way ...
60 bool pick( std::vector<SGSceneryPick>& pickList,
61 const osgGA::GUIEventAdapter* ea );
63 /** Get and set the OSG Viewer object, if any.
65 osgViewer::Viewer* getViewer() { return viewer.get(); }
66 const osgViewer::Viewer* getViewer() const { return viewer.get(); }
67 void setViewer(osgViewer::Viewer* viewer);
68 /** Get and set the manipulator object, if any.
70 flightgear::FGEventHandler* getEventHandler() { return eventHandler.get(); }
71 const flightgear::FGEventHandler* getEventHandler() const { return eventHandler.get(); }
72 void setEventHandler(flightgear::FGEventHandler* manipulator);
74 /** Add a top level camera.
76 void addCamera(osg::Camera* camera, bool useSceneData);
78 /** Add a camera to the group. The camera is added to the viewer
79 * as a slave. See osgViewer::Viewer::addSlave.
80 * @param flags properties of the camera; see CameraGroup::Flags
81 * @param projection slave projection matrix
82 * @param view slave view matrix
83 * @param useMasterSceneData whether the camera displays the
84 * viewer's scene data.
85 * @return a CameraInfo object for the camera.
87 flightgear::CameraInfo* buildRenderingPipeline(flightgear::CameraGroup* cgroup, unsigned flags, osg::Camera* camera,
88 const osg::Matrix& view,
89 const osg::Matrix& projection,
90 bool useMasterSceneData);
94 flightgear::CameraInfo* buildClassicalPipeline(flightgear::CameraGroup* cgroup, unsigned flags, osg::Camera* camera,
95 const osg::Matrix& view,
96 const osg::Matrix& projection,
97 bool useMasterSceneData);
101 flightgear::CameraInfo* buildDeferredPipeline(flightgear::CameraGroup* cgroup, unsigned flags, osg::Camera* camera,
102 const osg::Matrix& view,
103 const osg::Matrix& projection);
105 SGSky* getSky() const { return _sky; }
108 * inform the renderer when the global (2D) panel is changed
112 osg::ref_ptr<osgViewer::Viewer> viewer;
113 osg::ref_ptr<flightgear::FGEventHandler> eventHandler;
114 SGPropertyNode_ptr _scenery_loaded,_scenery_override;
115 SGPropertyNode_ptr _skyblend, _splash_alpha;
116 SGPropertyNode_ptr _point_sprites, _enhanced_lighting, _distance_attenuation;
117 SGPropertyNode_ptr _textures;
118 SGPropertyNode_ptr _cloud_status, _visibility_m;
119 SGPropertyNode_ptr _xsize, _ysize;
120 SGPropertyNode_ptr _panel_hotspots, _sim_delta_sec, _horizon_effect, _altitude_ft;
121 SGPropertyNode_ptr _virtual_cockpit;
122 SGTimeStamp _splash_time;
124 bool _classicalRenderer;
127 bool fgDumpSceneGraphToFile(const char* filename);
128 bool fgDumpTerrainBranchToFile(const char* filename);
132 bool printVisibleSceneInfo(FGRenderer* renderer);