1 // Owner Drawn Gauge helper class
3 // Written by Harald JOHNSEN, started May 2005.
5 // Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
7 // Ported to OSG by Tim Moore - Jun 2007
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #include <osg/Texture2D>
31 #include <simgear/structure/subsystem_mgr.hxx>
34 * Owner Drawn Gauge helper class.
36 class FGODGauge : public SGSubsystem {
39 FGODGauge ( SGPropertyNode *node );
43 virtual void update (double dt);
45 void setSize(int viewSize);
50 * Say if we can render to a texture.
51 * @return true if rtt is available
53 bool serviceable(void);
56 * Replace an opengl texture name inside the aircraft scene graph.
57 * This is to replace a static texture by a dynamic one
58 * @param name texture filename
59 * @param new_texture dynamic texture to replace the old one
61 void set_texture(const char * name, osg::Texture2D* new_texture);
64 * Get the OSG camera for drawing this gauge.
66 osg::Camera* getCamera() { return camera.get(); }
68 osg::Texture2D* getTexture() { return texture.get(); }
69 void setTexture(osg::Texture2D* t) { texture = t; }
71 // Real initialization function. Bad name.
77 osg::ref_ptr<osg::Camera> camera;
78 osg::ref_ptr<osg::Texture2D> texture;
82 #endif // _OD_GAUGE_HXX