1 // Owner Drawn Gauge helper class
3 // Written by Harald JOHNSEN, started May 2005.
5 // Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include <osg/Texture2D>
28 #include <simgear/structure/subsystem_mgr.hxx>
31 * Owner Drawn Gauge helper class.
33 class FGODGauge : public SGSubsystem {
36 FGODGauge ( SGPropertyNode *node );
40 virtual void update (double dt);
43 * Start the rendering of the RTT context.
44 * @param viewSize size of the destination texture
46 void beginCapture(int viewSize);
48 * Start the rendering of the RTT context.
50 void beginCapture(void);
52 * Clear the background.
56 * Finish rendering and save the buffer to a texture.
57 * @param texID name of a gl texture
59 void endCapture(osg::Texture2D*);
61 * Set the size of the destination texture.
62 * @param viewSize size of the destination texture
64 void setSize(int viewSize);
66 * Say if we can render to a texture.
67 * @return true if rtt is available
69 bool serviceable(void);
71 * Replace an opengl texture name inside the aircraft scene graph.
72 * This is to replace a static texture by a dynamic one
73 * @param name texture filename
74 * @param new_texture dynamic texture to replace the old one
76 void set_texture(const char * name, osg::Texture2D* new_texture);
87 #endif // _OD_GAUGE_HXX