Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

gltext::Stream Class Reference

#include <gltext.h>

List of all members.

Public Methods

 Stream (FontRenderer *r)
 Stream (const FontRendererPtr &p)
Stream & get ()
FontRenderergetRenderer ()
void flush ()


Detailed Description

Provides an iostream-like interface to a font renderer. Use as follows: Stream(renderer).get() << blah blah blah;

The GLTEXT_STREAM macro may be simpler: GLTEXT_STREAM(renderer) << blah blah blah;


Member Function Documentation

void gltext::Stream::flush   [inline]
 

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.

Stream& gltext::Stream::get   [inline]
 

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().


The documentation for this class was generated from the following file:
Generated on Mon Aug 4 22:04:32 2003 for GLText by doxygen1.3-rc1