]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/sphere.cxx
Merge branch 'ehofman/sound'
[simgear.git] / simgear / scene / sky / sphere.cxx
index 11251b0ab6a0003734b1d34442f5d6fa85acabb4..cee7ef415a11fc7660fd6e56928ae5753727b4b6 100644 (file)
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
+#ifdef __CYGWIN__
+#include <ieeefp.h>
+#endif
 
 
 #include <simgear/compiler.h>
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 
-#include STL_IOSTREAM
+#include <iostream>
 
 #include <osg/Node>
 #include <osg/Geometry>
@@ -110,12 +113,17 @@ SGMakeSphere(double radius, int slices, int stacks)
            exit(-1);
        }
 
+        // colors
+        osg::Vec4Array* cl = new osg::Vec4Array;
+        cl->push_back(osg::Vec4(1, 1, 1, 1));
+
         geometry->setUseDisplayList(false);
         geometry->setVertexArray(vl);
         geometry->setNormalArray(nl);
         geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);
         geometry->setTexCoordArray(0, tl);
-        geometry->setColorBinding(osg::Geometry::BIND_OFF);
+        geometry->setColorArray(cl);
+        geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
         geometry->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLE_STRIP, 0, vl->size()));
         geode->addDrawable(geometry);