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>
10 #include <osgViewer/Viewer>
12 #include "FGManipulator.hxx"
14 #define FG_ENABLE_MULTIPASS_CLOUDS 1
19 extern glPointParameterfProc glPointParameterfPtr;
20 extern glPointParameterfvProc glPointParameterfvPtr;
21 extern bool glPointParameterIsSupported;
22 extern bool glPointSpriteIsSupported;
35 static void resize(int width, int height );
37 // calling update( refresh_camera_settings = false ) will not
38 // touch window or camera settings. This is useful for the tiled
39 // renderer which needs to set the view frustum itself.
40 static void update( bool refresh_camera_settings );
41 inline static void update() { update( true ); }
44 /** FlightGear code should use this routine to set the FOV rather
45 * than calling the ssg routine directly
47 static void setFOV( float w, float h );
50 /** FlightGear code should use this routine to set the Near/Far
51 * clip planes rather than calling the ssg routine directly
53 static void setNearFar( float n, float f );
55 /** Just pick into the scene and return the pick callbacks on the way ...
57 static bool pick( unsigned x, unsigned y,
58 std::vector<SGSceneryPick>& pickList,
59 const osgGA::GUIEventAdapter* ea );
61 /** Get and set the OSG Viewer object, if any.
63 osgViewer::Viewer* getViewer() { return viewer.get(); }
64 const osgViewer::Viewer* getViewer() const { return viewer.get(); }
65 void setViewer(osgViewer::Viewer* viewer) { this->viewer = viewer; }
66 /** Get and set the manipulator object, if any.
68 FGManipulator* getManipulator() { return manipulator.get(); }
69 const FGManipulator* getManipulator() const { return manipulator.get(); }
70 void setManipulator(FGManipulator* manipulator) {
71 this->manipulator = manipulator;
74 /** Add a top level camera.
76 void addCamera(osg::Camera* camera, bool useSceneData);
79 osg::ref_ptr<osgViewer::Viewer> viewer;
80 osg::ref_ptr<FGManipulator> manipulator;
83 bool fgDumpSceneGraphToFile(const char* filename);