2 #ifndef __FG_RENDERER_HXX
3 #define __FG_RENDERER_HXX 1
5 #include <simgear/screen/extensions.hxx>
6 #include <simgear/scene/util/SGPickCallback.hxx>
18 class GUIEventAdapter;
36 #define FG_ENABLE_MULTIPASS_CLOUDS 1
51 static void resize(int width, int height );
53 // calling update( refresh_camera_settings = false ) will not
54 // touch window or camera settings. This is useful for the tiled
55 // renderer which needs to set the view frustum itself.
56 static void update( bool refresh_camera_settings );
57 inline static void update() { update( true ); }
59 /** Just pick into the scene and return the pick callbacks on the way ...
61 static bool pick( std::vector<SGSceneryPick>& pickList,
62 const osgGA::GUIEventAdapter* ea );
64 /** Get and set the OSG Viewer object, if any.
66 osgViewer::Viewer* getViewer() { return viewer.get(); }
67 const osgViewer::Viewer* getViewer() const { return viewer.get(); }
68 void setViewer(osgViewer::Viewer* viewer);
69 /** Get and set the manipulator object, if any.
71 flightgear::FGEventHandler* getEventHandler() { return eventHandler.get(); }
72 const flightgear::FGEventHandler* getEventHandler() const { return eventHandler.get(); }
73 void setEventHandler(flightgear::FGEventHandler* manipulator);
75 /** Add a top level camera.
77 void addCamera(osg::Camera* camera, bool useSceneData);
80 osg::ref_ptr<osgViewer::Viewer> viewer;
81 osg::ref_ptr<flightgear::FGEventHandler> eventHandler;
84 bool fgDumpSceneGraphToFile(const char* filename);
85 bool fgDumpTerrainBranchToFile(const char* filename);