287 |
} |
} |
288 |
/** Initialize OpenGL state for rendering. |
/** Initialize OpenGL state for rendering. |
289 |
*/ |
*/ |
290 |
void startRendering() { |
template<class TexBind> void startRendering(TexBind t) { |
291 |
glBegin(GL_QUADS); |
glBegin(GL_QUADS); |
292 |
curtex = Mosaic::Id(); // clear. |
curtex = Mosaic::Id(); // clear. Id() constructs texid 0. |
293 |
} |
} |
294 |
/** Render a single character. |
/** Render a single character. |
295 |
* @return New x position. |
* @return New x position. |
310 |
} |
} |
311 |
/** Finish OpenGL state for rendering. |
/** Finish OpenGL state for rendering. |
312 |
*/ |
*/ |
313 |
void endRendering() { |
template<class TexBind> void endRendering(TexBind t) { |
314 |
glEnd(); |
glEnd(); |
315 |
|
t(Mosaic::Id()); // clear the bound texture - bind zero. |
316 |
} |
} |
317 |
|
|
318 |
}; |
}; |
328 |
Iterator begin, Iterator end, |
Iterator begin, Iterator end, |
329 |
float x, float y, |
float x, float y, |
330 |
Vertex &vertex, TexBind t) { |
Vertex &vertex, TexBind t) { |
331 |
r.startRendering(); |
r.startRendering(t); |
332 |
while(begin != end) { |
while(begin != end) { |
333 |
x = r.renderChar(*begin, x, y, vertex, t); |
x = r.renderChar(*begin, x, y, vertex, t); |
334 |
begin++; |
begin++; |
335 |
} |
} |
336 |
r.endRendering(); |
r.endRendering(t); |
337 |
return x; |
return x; |
338 |
} |
} |
339 |
|
|