]> git.mxchange.org Git - flightgear.git/blob - src/Main/renderer.hxx
#545: Fix ATC chatter sound settings being ignored
[flightgear.git] / src / Main / renderer.hxx
1
2 #ifndef __FG_RENDERER_HXX
3 #define __FG_RENDERER_HXX 1
4
5 #include <simgear/scene/util/SGPickCallback.hxx>
6 #include <simgear/props/props.hxx>
7 #include <simgear/timing/timestamp.hxx>
8
9 #include <osg/ref_ptr>
10
11 namespace osg
12 {
13 class Camera;
14 class Group;
15 }
16
17 namespace osgGA
18 {
19 class GUIEventAdapter;
20 }
21
22 namespace osgShadow
23 {
24 class ShadowedScene;
25 }
26
27 namespace osgViewer
28 {
29 class Viewer;
30 }
31
32 namespace flightgear
33 {
34 class FGEventHandler;
35 }
36
37 class SGSky;
38
39 class FGRenderer {
40
41 public:
42
43     FGRenderer();
44     ~FGRenderer();
45
46     void splashinit();
47     void init();
48
49     void setupView();
50
51     void resize(int width, int height );
52
53     void update();
54   
55     /** Just pick into the scene and return the pick callbacks on the way ...
56      */
57     bool pick( std::vector<SGSceneryPick>& pickList,
58                const osgGA::GUIEventAdapter* ea );
59
60     /** Get and set the OSG Viewer object, if any.
61      */
62     osgViewer::Viewer* getViewer() { return viewer.get(); }
63     const osgViewer::Viewer* getViewer() const { return viewer.get(); }
64     void setViewer(osgViewer::Viewer* viewer);
65     /** Get and set the manipulator object, if any.
66      */
67     flightgear::FGEventHandler* getEventHandler() { return eventHandler.get(); }
68     const flightgear::FGEventHandler* getEventHandler() const { return eventHandler.get(); }
69     void setEventHandler(flightgear::FGEventHandler* manipulator);
70
71     /** Add a top level camera.
72     */
73     void addCamera(osg::Camera* camera, bool useSceneData);
74
75     SGSky* getSky() const { return _sky; }
76     
77 protected:
78     osg::ref_ptr<osgViewer::Viewer> viewer;
79     osg::ref_ptr<flightgear::FGEventHandler> eventHandler;
80     SGPropertyNode_ptr _scenery_loaded,_scenery_override;
81     SGPropertyNode_ptr _skyblend, _splash_alpha;
82     SGPropertyNode_ptr _point_sprites, _enhanced_lighting, _distance_attenuation;
83     SGPropertyNode_ptr _textures;
84     SGPropertyNode_ptr _cloud_status, _visibility_m; 
85     SGPropertyNode_ptr _xsize, _ysize;
86     SGPropertyNode_ptr _panel_hotspots, _sim_delta_sec, _horizon_effect, _altitude_ft;
87     SGPropertyNode_ptr _virtual_cockpit;
88     SGTimeStamp _splash_time;
89     SGSky* _sky;
90 };
91
92 bool fgDumpSceneGraphToFile(const char* filename);
93 bool fgDumpTerrainBranchToFile(const char* filename);
94
95 namespace flightgear
96 {
97 bool printVisibleSceneInfo(FGRenderer* renderer);
98 }
99
100 #endif