From 92abaca21021d5db729366d8da7e6f5703cb33a4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 29 Jul 2019 13:01:00 +0100 Subject: [PATCH] Replaced GL_QUADS usage with GL_TRIANGLE_STRIP --- src/osgViewer/config/WoWVxDisplay.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/osgViewer/config/WoWVxDisplay.cpp b/src/osgViewer/config/WoWVxDisplay.cpp index c15c756e1..4a5efae2d 100644 --- a/src/osgViewer/config/WoWVxDisplay.cpp +++ b/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);