// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "FGMagRibbon.hxx"
}
void
-FGMagRibbon::draw ()
+FGMagRibbon::draw (osg::State& state)
{
double heading = _magcompass_node->getDoubleValue();
double xoffset, yoffset;
// Adjust to put the number in the centre
xoffset -= 0.25;
- FGCroppedTexture &t = getTexture();
- t.setCrop(xoffset, yoffset, xoffset + 0.5, yoffset + 0.25);
+ FGCroppedTexture *t = getTexture();
+ t->setCrop(xoffset, yoffset, xoffset + 0.5, yoffset + 0.25);
+
+ static osg::ref_ptr<osg::StateSet> stateSet = new osg::StateSet;
+ stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
+
+ state.pushStateSet(stateSet.get());
+ state.apply();
+
+ FGTexturedLayer::draw(state);
- glPushAttrib(GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
- FGTexturedLayer::draw();
- glPopAttrib();
+ state.popStateSet();
+ state.apply();
}
// end of FGMagRibbon.cxx