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();
}
}
unsigned ymax = y.size()-(border.top ? 2 : 3);
bld.color(1.0f, 1.0f, 1.0f);
- bld.begin(GL::QUADS);
for(unsigned i=ymin; i<=ymax; ++i)
{
unsigned i2 = (i==0 ? 0 : i==y.size()-2 ? 2 : 1);
for(unsigned j=xmin; j<=xmax; ++j)
{
unsigned j2 = (j==0 ? 0 : j==x.size()-2 ? 2 : 1);
- bld.texcoord(u[j2], v[i2]);
- bld.vertex(x[j], y[i]);
- bld.texcoord(u[j2+1], v[i2]);
- bld.vertex(x[j+1], y[i]);
+ if(j==xmin || (j>1 && j<x.size()-2))
+ {
+ if(j>xmin)
+ bld.end();
+ bld.begin(GL::TRIANGLE_STRIP);
+ bld.texcoord(u[j2], v[i2+1]);
+ bld.vertex(x[j], y[i+1]);
+ bld.texcoord(u[j2], v[i2]);
+ bld.vertex(x[j], y[i]);
+ }
bld.texcoord(u[j2+1], v[i2+1]);
bld.vertex(x[j+1], y[i+1]);
- bld.texcoord(u[j2], v[i2+1]);
- bld.vertex(x[j], y[i+1]);
+ bld.texcoord(u[j2+1], v[i2]);
+ bld.vertex(x[j+1], y[i]);
}
+ bld.end();
}
- bld.end();
}
void Graphic::create_coords(float low, float high, float brd1, float brd2, float block, vector<float> &coords) const
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();
}
}