2 #ifndef __FG_RENDERER_HXX
3 #define __FG_RENDERER_HXX 1
5 #include <simgear/screen/extensions.hxx>
6 #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 ); }
42 /** Set all the camera parameters at once. aspectRatio is height / width.
44 static void setCameraParameters(float vfov, float aspectRatio,
45 float zNear, float zFar);
46 /** Just pick into the scene and return the pick callbacks on the way ...
48 static bool pick( std::vector<SGSceneryPick>& pickList,
49 const osgGA::GUIEventAdapter* ea );
51 /** Get and set the OSG Viewer object, if any.
53 osgViewer::Viewer* getViewer() { return viewer.get(); }
54 const osgViewer::Viewer* getViewer() const { return viewer.get(); }
55 void setViewer(osgViewer::Viewer* viewer) { this->viewer = viewer; }
56 /** Get and set the manipulator object, if any.
58 flightgear::FGManipulator* getManipulator() { return manipulator.get(); }
59 const flightgear::FGManipulator* getManipulator() const { return manipulator.get(); }
60 void setManipulator(flightgear::FGManipulator* manipulator) {
61 this->manipulator = manipulator;
64 /** Add a top level camera.
66 void addCamera(osg::Camera* camera, bool useSceneData);
69 osg::ref_ptr<osgViewer::Viewer> viewer;
70 osg::ref_ptr<flightgear::FGManipulator> manipulator;
73 bool fgDumpSceneGraphToFile(const char* filename);
74 bool fgDumpTerrainBranchToFile(const char* filename);