Skip to content
Permalink
Browse files

Replaced GL_QUADS usage with GL_TRIANGLE_STRIP

  • Loading branch information...
robertosfield committed Jul 29, 2019
1 parent 8fad6bd commit 2b5e65997354f0d34cd3fab742bb45af69611c50
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/osgViewer/config/WoWVxDisplay.cpp
@@ -171,20 +171,21 @@ void WoWVxDisplay::configure(osgViewer::View& view) const
osg::Vec3Array* vertices = new osg::Vec3Array;
vertices->push_back(osg::Vec3(0,height,0));
vertices->push_back(osg::Vec3(0,0,0));
vertices->push_back(osg::Vec3(width,0,0));
vertices->push_back(osg::Vec3(width,height,0));
vertices->push_back(osg::Vec3(width,0,0));
geom->setVertexArray(vertices);

osg::Vec2Array* tex = new osg::Vec2Array;
tex->push_back(osg::Vec2(0,1));
tex->push_back(osg::Vec2(0,0));
tex->push_back(osg::Vec2(1,0));
tex->push_back(osg::Vec2(1,1));
tex->push_back(osg::Vec2(1,0));
geom->setTexCoordArray(0,tex);

geom->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4));
geom->addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLE_STRIP,0,4));
geode->addDrawable(geom);


// new we need to add the textures to the quad, and setting up the shader.
osg::StateSet* stateset = geode->getOrCreateStateSet();
stateset->setTextureAttributeAndModes(0, textureHeader,osg::StateAttribute::ON);

0 comments on commit 2b5e659

Please sign in to comment.
You can’t perform that action at this time.