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/ref_ptr>
37 * Owner Drawn Gauge helper class.
46 void setSize(int viewSize);
51 * Say if we can render to a texture.
52 * @return true if rtt is available
54 bool serviceable(void);
57 * Replace an opengl texture name inside the aircraft scene graph.
58 * This is to replace a static texture by a dynamic one
59 * @param name texture filename
60 * @param new_texture dynamic texture to replace the old one
62 void set_texture(const char * name, osg::Texture2D* new_texture);
65 * Get the OSG camera for drawing this gauge.
67 osg::Camera* getCamera() { return camera.get(); }
69 osg::Texture2D* getTexture() { return texture.get(); }
70 void setTexture(osg::Texture2D* t) { texture = t; }
72 // Real initialization function. Bad name.
78 osg::ref_ptr<osg::Camera> camera;
79 osg::ref_ptr<osg::Texture2D> texture;
83 #endif // _OD_GAUGE_HXX