#include <gltext.h>
Public Methods | |
Stream (FontRenderer *r) | |
Stream (const FontRendererPtr &p) | |
Stream & | get () |
FontRenderer * | getRenderer () |
void | flush () |
The GLTEXT_STREAM macro may be simpler: GLTEXT_STREAM(renderer) << blah blah blah;
|
Calls render() on the associated FontRenderer using the string that has been created so far. Then it sets the string to empty. flush() is called before any GLText manipulator and when the font stream is destroyed. |
|
This is a little trick to convert an rvalue to an lvalue. The problem is this: class temporaries created with FontStream(r) are rvalues, which means they cannot be assigned to FontStream& references. Therefore, temporaries cannot be used as arguments to the standard operator<< overloads. However! You CAN call methods on object rvalues and methods CAN return lvalues! This method effectively converts *this from an rvalue to an lvalue using the syntax: FontStream(r).get(). |