]> git.mxchange.org Git - flightgear.git/blob - src/Main/renderer.hxx
Remove current_aircraft global, fgAIRCRAFT struct, and dead code for reading aircraft...
[flightgear.git] / src / Main / renderer.hxx
1
2 #ifndef __FG_RENDERER_HXX
3 #define __FG_RENDERER_HXX 1
4
5 #include <simgear/screen/extensions.hxx>
6 #include <simgear/scene/util/SGPickCallback.hxx>
7
8 #include <osg/ref_ptr>
9
10 namespace osg
11 {
12 class Camera;
13 class Group;
14 }
15
16 namespace osgGA
17 {
18 class GUIEventAdapter;
19 }
20
21 namespace osgShadow
22 {
23 class ShadowedScene;
24 }
25
26 namespace osgViewer
27 {
28 class Viewer;
29 }
30
31 namespace flightgear
32 {
33 class FGEventHandler;
34 }
35
36 class SGSky;
37 extern SGSky *thesky;
38
39 class FGRenderer {
40
41 public:
42
43     FGRenderer();
44     ~FGRenderer();
45
46     void splashinit();
47     void init();
48
49     static void resize(int width, int height );
50
51     // calling update( refresh_camera_settings = false ) will not
52     // touch window or camera settings.  This is useful for the tiled
53     // renderer which needs to set the view frustum itself.
54     static void update( bool refresh_camera_settings );
55     inline static void update() { update( true ); }
56
57     /** Just pick into the scene and return the pick callbacks on the way ...
58      */
59     static bool pick( std::vector<SGSceneryPick>& pickList,
60                       const osgGA::GUIEventAdapter* ea );
61
62     /** Get and set the OSG Viewer object, if any.
63      */
64     osgViewer::Viewer* getViewer() { return viewer.get(); }
65     const osgViewer::Viewer* getViewer() const { return viewer.get(); }
66     void setViewer(osgViewer::Viewer* viewer);
67     /** Get and set the manipulator object, if any.
68      */
69     flightgear::FGEventHandler* getEventHandler() { return eventHandler.get(); }
70     const flightgear::FGEventHandler* getEventHandler() const { return eventHandler.get(); }
71     void setEventHandler(flightgear::FGEventHandler* manipulator);
72
73     /** Add a top level camera.
74     */
75     void addCamera(osg::Camera* camera, bool useSceneData);
76
77 protected:
78     osg::ref_ptr<osgViewer::Viewer> viewer;
79     osg::ref_ptr<flightgear::FGEventHandler> eventHandler;
80 };
81
82 bool fgDumpSceneGraphToFile(const char* filename);
83 bool fgDumpTerrainBranchToFile(const char* filename);
84
85 #endif