]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/button.cpp
Use triangle strips instead of quads
[libs/gltk.git] / source / button.cpp
index 57e5fa42f57981cfb3398576b5a6563b3d5b4843..86b73c9daa0c3f8ba9a689ebf628f102667c97f7 100644 (file)
@@ -56,15 +56,15 @@ void Button::rebuild_special(const Part &part)
 
                        GL::MeshBuilder bld(part_cache.create_mesh(part, *icon));
                        bld.color(1.0f, 1.0f, 1.0f);
-                       bld.begin(GL::QUADS);
+                       bld.begin(GL::TRIANGLE_STRIP);
+                       bld.texcoord(0, 1);
+                       bld.vertex(rgeom.x, rgeom.y+rgeom.h);
                        bld.texcoord(0, 0);
                        bld.vertex(rgeom.x, rgeom.y);
-                       bld.texcoord(1, 0);
-                       bld.vertex(rgeom.x+rgeom.w, rgeom.y);
                        bld.texcoord(1, 1);
                        bld.vertex(rgeom.x+rgeom.w, rgeom.y+rgeom.h);
-                       bld.texcoord(0, 1);
-                       bld.vertex(rgeom.x, rgeom.y+rgeom.h);
+                       bld.texcoord(1, 0);
+                       bld.vertex(rgeom.x+rgeom.w, rgeom.y);
                        bld.end();
                }
        }