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, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
28 #include <simgear/structure/subsystem_mgr.hxx>
33 * Owner Drawn Gauge helper class.
35 class FGODGauge : public SGSubsystem {
38 FGODGauge ( SGPropertyNode *node );
42 virtual void update (double dt);
45 * Start the rendering of the RTT context.
46 * @param viewSize size of the destination texture
48 void beginCapture(int viewSize);
50 * Start the rendering of the RTT context.
52 void beginCapture(void);
54 * Clear the background.
58 * Finish rendering and save the buffer to a texture.
59 * @param texID name of a gl texture
61 void endCapture(GLuint texID);
63 * Set the size of the destination texture.
64 * @param viewSize size of the destination texture
66 void setSize(int viewSize);
68 * Say if we can render to a texture.
69 * @return true if rtt is available
71 bool serviceable(void);
73 * Replace an opengl texture name inside the aircraft scene graph.
74 * This is to replace a static texture by a dynamic one
75 * @param name texture filename
76 * @param new_texture dynamic texture to replace the old one
78 void set_texture(const char * name, GLuint new_texture);
90 #endif // _OD_GAUGE_HXX