2 #ifndef __FG_RENDERER_HXX
3 #define __FG_RENDERER_HXX 1
5 #include <simgear/screen/extensions.hxx>
6 #include <simgear/scene/sky/sky.hxx>
7 #include <simgear/scene/util/SGPickCallback.hxx>
9 #include <osgViewer/Viewer>
11 #include "FGManipulator.hxx"
13 #define FG_ENABLE_MULTIPASS_CLOUDS 1
18 extern glPointParameterfProc glPointParameterfPtr;
19 extern glPointParameterfvProc glPointParameterfvPtr;
20 extern bool glPointParameterIsSupported;
21 extern bool glPointSpriteIsSupported;
34 static void resize(int width, int height );
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 ); }
43 /** FlightGear code should use this routine to set the FOV rather
44 * than calling the ssg routine directly
46 static void setFOV( float w, float h );
49 /** FlightGear code should use this routine to set the Near/Far
50 * clip planes rather than calling the ssg routine directly
52 static void setNearFar( float n, float f );
54 /** Just pick into the scene and return the pick callbacks on the way ...
56 static bool pick( unsigned x, unsigned y,
57 std::vector<SGSceneryPick>& pickList );
59 /** Get and set the OSG Viewer object, if any.
61 osgViewer::Viewer* getViewer() { return viewer.get(); }
62 const osgViewer::Viewer* getViewer() const { return viewer.get(); }
63 void setViewer(osgViewer::Viewer* viewer) { this->viewer = viewer; }
64 /** Get and set the manipulator object, if any.
66 FGManipulator* getManipulator() { return manipulator.get(); }
67 const FGManipulator* getManipulator() const { return manipulator.get(); }
68 void setManipulator(FGManipulator* manipulator)
70 this->manipulator = manipulator;
73 osg::ref_ptr<osgViewer::Viewer> viewer;
74 osg::ref_ptr<FGManipulator> manipulator;
77 bool fgDumpSceneGraphToFile(const char* filename);