]> git.mxchange.org Git - flightgear.git/commitdiff
Set BACKGROUND_BIT as camera node mask.
authortimoore <timoore>
Tue, 30 Dec 2008 23:36:51 +0000 (23:36 +0000)
committerTim Moore <timoore@redhat.com>
Sat, 3 Jan 2009 22:56:39 +0000 (23:56 +0100)
This prevents the dreaded black rectangle from appearing on systems
that don't have OpenGL frame buffer object support.

src/Instrumentation/od_gauge.cxx

index 25184450c1229dea298760a6b2b323e12c0abce9..820f0a9d8744d2de031d82a7484731634f41d9e7 100644 (file)
@@ -37,6 +37,7 @@
 #include <osg/StateSet>
 #include <osgDB/FileNameUtils>
 
+#include <simgear/scene/util/RenderConstants.hxx>
 #include <simgear/screen/extensions.hxx>
 #include <simgear/debug/logstream.hxx>
 
@@ -53,6 +54,8 @@ FGODGauge::FGODGauge() :
 
 void FGODGauge::allocRT () {
     camera = new osg::Camera;
+    // Only the far camera should trigger this texture to be rendered.
+    camera->setNodeMask(simgear::BACKGROUND_BIT);
     camera->setProjectionMatrix(osg::Matrix::ortho2D(-256.0, 256.0, -256.0,
             256.0));
     camera->setViewport(0, 0, textureWH, textureWH);