]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/image.cpp
Use triangle strips instead of quads
[libs/gltk.git] / source / image.cpp
index 5dcb2e3f5b84b8e727a98b3aa6180c3642b35a24..f1180c39e1664491fd239560d59f251b8194074a 100644 (file)
@@ -76,15 +76,15 @@ void Image::rebuild_special(const Part &part)
 
                GL::MeshBuilder bld(part_cache.create_mesh(part, *image));
                bld.color(1.0f, 1.0f, 1.0f);
-               bld.begin(GL::QUADS);
+               bld.begin(GL::TRIANGLE_STRIP);
+               bld.texcoord(0.0, 1.0);
+               bld.vertex(rgeom.x, rgeom.y+rgeom.h);
                bld.texcoord(0.0, 0.0);
                bld.vertex(rgeom.x, rgeom.y);
-               bld.texcoord(1.0, 0.0);
-               bld.vertex(rgeom.x+rgeom.w, rgeom.y);
                bld.texcoord(1.0, 1.0);
                bld.vertex(rgeom.x+rgeom.w, rgeom.y+rgeom.h);
-               bld.texcoord(0.0, 1.0);
-               bld.vertex(rgeom.x, rgeom.y+rgeom.h);
+               bld.texcoord(1.0, 0.0);
+               bld.vertex(rgeom.x+rgeom.w, rgeom.y);
                bld.end();
        }
 }