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.
"
This commit is contained in:
Robert Osfield 2016-02-19 15:01:27 +00:00
parent 9132d98785
commit 4371512dd2

View File

@ -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);