]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/CameraGroup.cxx
Merge branch 'curt/replay' into next
[flightgear.git] / src / Main / CameraGroup.cxx
index 04ab9e135bc18bbe97ebb0f871287c8a6afd57d4..954a591e55d0c41ad761b2772d557aec8eda639b 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include "CameraGroup.hxx"
 
 #include "globals.hxx"
@@ -198,7 +202,7 @@ void CameraGroup::update(const osg::Vec3d& position,
                 camera->setProjectionMatrix(projectionMatrix);
                 camera->setCullMask(camera->getCullMask()
                                     | simgear::BACKGROUND_BIT);
-                camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+                camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
                 farCamera->setNodeMask(0);
             } else {
                 Matrix nearProj, farProj;
@@ -298,7 +302,6 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode)
     WindowBuilder *wBuild = WindowBuilder::getWindowBuilder();
     const SGPropertyNode* windowNode = cameraNode->getNode("window");
     GraphicsWindow* window = 0;
-    static int cameraNum = 0;
     int cameraFlags = DO_INTERSECTION_TEST;
     if (windowNode) {
         // New style window declaration / definition
@@ -318,7 +321,11 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode)
                            | CullSettings::VIEW_FRUSTUM_CULLING);
     camera->setInheritanceMask(CullSettings::ALL_VARIABLES
                                & ~(CullSettings::CULL_MASK
-                                   | CullSettings::CULLING_MODE));
+                                   | CullSettings::CULLING_MODE
+#if defined(HAVE_CULLSETTINGS_CLEAR_MASK)
+                                   | CullSettings::CLEAR_MASK
+#endif
+                                   ));
 
     osg::Matrix pOff;
     osg::Matrix vOff;
@@ -400,7 +407,6 @@ CameraInfo* CameraGroup::buildGUICamera(SGPropertyNode* cameraNode,
     const SGPropertyNode* windowNode = (cameraNode
                                         ? cameraNode->getNode("window")
                                         : 0);
-    static int cameraNum = 0;
     if (!window) {
         if (windowNode) {
             // New style window declaration / definition
@@ -420,7 +426,11 @@ CameraInfo* CameraGroup::buildGUICamera(SGPropertyNode* cameraNode,
         camera->setClearMask(0);
     camera->setInheritanceMask(CullSettings::ALL_VARIABLES
                                & ~(CullSettings::COMPUTE_NEAR_FAR_MODE
-                                   | CullSettings::CULLING_MODE));
+                                   | CullSettings::CULLING_MODE
+#if defined(HAVE_CULLSETTINGS_CLEAR_MASK)
+                                   | CullSettings::CLEAR_MASK
+#endif
+                                   ));
     camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
     camera->setCullingMode(osg::CullSettings::NO_CULLING);
     camera->setProjectionResizePolicy(Camera::FIXED);