X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fcanvas%2FODGauge.hxx;h=5a07d69e2e53c59c498794e7f88e992e6861f0d8;hb=b99f53fda3b06378668bdccd4a9d07161f263366;hp=64efa84e936ce46335989d2befab1b7047501cb4;hpb=f191b4f35c26d38cf856a9ea0e69706d2167396b;p=simgear.git diff --git a/simgear/canvas/ODGauge.hxx b/simgear/canvas/ODGauge.hxx index 64efa84e..5a07d69e 100644 --- a/simgear/canvas/ODGauge.hxx +++ b/simgear/canvas/ODGauge.hxx @@ -10,30 +10,28 @@ // Supports now multisampling/mipmapping, usage of the stencil buffer and placing // the texture in the scene by certain filter criteria // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// +// Library General Public License for more details. // +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA #ifndef _SG_OD_GAUGE_HXX #define _SG_OD_GAUGE_HXX +#include "canvas_fwd.hxx" + #include #include -#include - namespace osg { class Camera; @@ -42,6 +40,9 @@ namespace osg namespace simgear { +namespace canvas +{ + /** * Owner Drawn Gauge (aka render-to-texture) helper class */ @@ -49,12 +50,11 @@ namespace simgear { public: - typedef boost::function CameraRegistrationCallback; - - ODGauge( const CameraRegistrationCallback& cb_camera_add, - const CameraRegistrationCallback& cb_camera_remove ); + ODGauge(); virtual ~ODGauge(); + void setSystemAdapter(const SystemAdapterPtr& system_adapter); + /** * Set the size of the render target. * @@ -124,7 +124,9 @@ namespace simgear // Real initialization function. Bad name. void allocRT(osg::NodeCallback* camera_cull_callback = 0); - private: + protected: + + SystemAdapterPtr _system_adapter; int _size_x, _size_y, @@ -142,15 +144,13 @@ namespace simgear osg::ref_ptr camera; osg::ref_ptr texture; - CameraRegistrationCallback _cb_cam_add, - _cb_cam_remove; - void updateCoordinateFrame(); void updateStencil(); void updateSampling(); }; +} // namespace canvas } // namespace simgear #endif // _SG_OD_GAUGE_HXX