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 ); }
43 /** Set all the camera parameters at once. aspectRatio is height / width.
45 static void setCameraParameters(float vfov, float aspectRatio,
46 float zNear, float zFar);
47 /** Just pick into the scene and return the pick callbacks on the way ...
49 static bool pick( unsigned x, unsigned y,
50 std::vector<SGSceneryPick>& pickList,
51 const osgGA::GUIEventAdapter* ea );
53 /** Get and set the OSG Viewer object, if any.
55 osgViewer::Viewer* getViewer() { return viewer.get(); }
56 const osgViewer::Viewer* getViewer() const { return viewer.get(); }
57 void setViewer(osgViewer::Viewer* viewer) { this->viewer = viewer; }
58 /** Get and set the manipulator object, if any.
60 FGManipulator* getManipulator() { return manipulator.get(); }
61 const FGManipulator* getManipulator() const { return manipulator.get(); }
62 void setManipulator(FGManipulator* manipulator) {
63 this->manipulator = manipulator;
66 /** Add a top level camera.
68 void addCamera(osg::Camera* camera, bool useSceneData);
71 osg::ref_ptr<osgViewer::Viewer> viewer;
72 osg::ref_ptr<FGManipulator> manipulator;
75 bool fgDumpSceneGraphToFile(const char* filename);
76 bool fgDumpTerrainBranchToFile(const char* filename);