From 78aaf7955e2d72e00db2f1cd6dcb9f8a927dd975 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 19 Feb 2016 15:01:27 +0000 Subject: [PATCH] From Bjorn Blissing, "I stumbled upon a strange ifdef-case inside Geometry.cpp Currently the code looks like this: Code: DrawElementsUByte* elems = new DrawElementsUByte(PrimitiveSet::TRIANGLES); elems->push_back(0); elems->push_back(1); elems->push_back(2); elems->push_back(2); elems->push_back(3); elems->push_back(0); geom->addPrimitiveSet(elems); geom->addPrimitiveSet(new DrawArrays(PrimitiveSet::QUADS,0,4)); The second condition looked really strange (note the ! sign), and results in pretty much all code paths uses the first code. The correct version should probably be that only people with GLES1 or GLES2 should use GL_TRIANGLES to simulate quads. And all others should use the native support for GL_QUADS. " --- src/osg/Geometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index eb5a88ab9..779e8cd81 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -1043,7 +1043,7 @@ Geometry* osg::createTexturedQuadGeometry(const Vec3& corner,const Vec3& widthVe geom->setNormalArray(normals, osg::Array::BIND_OVERALL); -#if defined(OSG_GLES1_AVAILABLE) || !defined(OSG_GLES2_AVAILABLE) +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) DrawElementsUByte* elems = new DrawElementsUByte(PrimitiveSet::TRIANGLES); elems->push_back(0); elems->push_back(1);