]> git.mxchange.org Git - flightgear.git/blob - src/Main/renderer.hxx
Modified Files:
[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/sky/sky.hxx>
7 #include <simgear/scene/util/SGPickCallback.hxx>
8
9 #include <osgViewer/Viewer>
10
11 #include "FGManipulator.hxx"
12
13 #define FG_ENABLE_MULTIPASS_CLOUDS 1
14
15 class SGSky;
16 extern SGSky *thesky;
17
18 extern glPointParameterfProc glPointParameterfPtr;
19 extern glPointParameterfvProc glPointParameterfvPtr;
20 extern bool glPointParameterIsSupported;
21 extern bool glPointSpriteIsSupported;
22
23
24 class FGRenderer {
25
26 public:
27
28     FGRenderer();
29     ~FGRenderer();
30
31     void splashinit();
32     void init();
33
34     static void resize(int width, int height );
35
36     // calling update( refresh_camera_settings = false ) will not
37     // touch window or camera settings.  This is useful for the tiled
38     // renderer which needs to set the view frustum itself.
39     static void update( bool refresh_camera_settings );
40     inline static void update() { update( true ); }
41
42
43     /** FlightGear code should use this routine to set the FOV rather
44      *  than calling the ssg routine directly
45      */
46     static void setFOV( float w, float h );
47
48
49     /** FlightGear code should use this routine to set the Near/Far
50      *  clip planes rather than calling the ssg routine directly
51      */
52     static void setNearFar( float n, float f );
53
54     /** Just pick into the scene and return the pick callbacks on the way ...
55      */
56     static bool pick( unsigned x, unsigned y,
57                       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) { this->viewer = viewer; }
65     /** Get and set the manipulator object, if any.
66      */
67     FGManipulator* getManipulator() { return manipulator.get(); }
68     const FGManipulator* getManipulator() const { return manipulator.get(); }
69     void setManipulator(FGManipulator* manipulator)
70         {
71             this->manipulator = manipulator;
72         }
73 protected:
74     osg::ref_ptr<osgViewer::Viewer> viewer;
75     osg::ref_ptr<FGManipulator> manipulator;
76 };
77
78 bool fgDumpSceneGraphToFile(const char* filename);
79
80 #endif