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;
49 static void resize(int width, int height );
51 // calling update( refresh_camera_settings = false ) will not
52 // touch window or camera settings. This is useful for the tiled
53 // renderer which needs to set the view frustum itself.
54 static void update( bool refresh_camera_settings );
55 inline static void update() { update( true ); }
57 /** Just pick into the scene and return the pick callbacks on the way ...
59 static bool pick( std::vector<SGSceneryPick>& pickList,
60 const osgGA::GUIEventAdapter* ea );
62 /** Get and set the OSG Viewer object, if any.
64 osgViewer::Viewer* getViewer() { return viewer.get(); }
65 const osgViewer::Viewer* getViewer() const { return viewer.get(); }
66 void setViewer(osgViewer::Viewer* viewer);
67 /** Get and set the manipulator object, if any.
69 flightgear::FGEventHandler* getEventHandler() { return eventHandler.get(); }
70 const flightgear::FGEventHandler* getEventHandler() const { return eventHandler.get(); }
71 void setEventHandler(flightgear::FGEventHandler* manipulator);
73 /** Add a top level camera.
75 void addCamera(osg::Camera* camera, bool useSceneData);
78 osg::ref_ptr<osgViewer::Viewer> viewer;
79 osg::ref_ptr<flightgear::FGEventHandler> eventHandler;
82 bool fgDumpSceneGraphToFile(const char* filename);
83 bool fgDumpTerrainBranchToFile(const char* filename);