]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/image.cpp
Add an input method subsystem
[libs/gltk.git] / source / image.cpp
index 8e14328c84b85aa073661cdb2dede39806715f20..383f906911993d2a83d8d434ec791f8c0e90d303 100644 (file)
@@ -12,10 +12,9 @@ Image::Image(const GL::Texture2D *i):
        image(i),
        keep_aspect(true)
 {
-       focusable = false;
 }
 
-void Image::autosize_special(const Part &part, Geometry &ageom)
+void Image::autosize_special(const Part &part, Geometry &ageom) const
 {
        if(part.get_name()=="image")
        {
@@ -76,15 +75,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();
        }
 }