Skip to content

Commit

Permalink
Replaced GL_QUADS usage with GL_TRIANGLE_STRIP
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Jul 29, 2019
1 parent 8fad6bd commit 2b5e659
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/osgViewer/config/WoWVxDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2b5e659

Please sign in to comment.