833 |
template<class Coords> struct Vertexer { |
template<class Coords> struct Vertexer { |
834 |
const Coords &c; |
const Coords &c; |
835 |
float wmul, hmul; |
float wmul, hmul; |
836 |
Vertexer(Coords &c, float wmul, float hmul) : c(c), wmul(wmul), hmul(hmul) { } |
ZPt origin; |
837 |
|
Vertexer(Coords &c, float wmul, float hmul, ZPt origin) : c(c), wmul(wmul), hmul(hmul), origin(origin) { } |
838 |
template<class T> void operator()(const T &x, const T &y) { |
template<class T> void operator()(const T &x, const T &y) { |
839 |
ZPt tmp(x * wmul, y * hmul, 0); |
ZVec tmp(x * wmul, y * hmul, 0); |
840 |
c.vertex(tmp); |
c.vertex(origin + tmp); |
841 |
} |
} |
842 |
}; |
}; |
843 |
""", |
""", |
844 |
"RenderCode" : """ |
"RenderCode" : """ |
845 |
Vertexer<Coords> v(coords1, widthmul, heightmul); |
Vertexer<Coords> v(coords1, widthmul, heightmul, origin); |
846 |
glPushAttrib(GL_ENABLE_BIT); |
glPushAttrib(GL_ENABLE_BIT); |
847 |
glEnable(GL_BLEND); |
glEnable(GL_BLEND); |
848 |
Text::renderIter(*r, txt.begin(), txt.end(), |
Text::renderIter(*r, txt.begin(), txt.end(), |