Equalizer 1.0

eq::util::BitmapFont< OMT > Class Template Reference

A wrapper around AGL, WGL and GLX bitmap fonts. More...

#include <bitmapFont.h>

Collaboration diagram for eq::util::BitmapFont< OMT >:

List of all members.

Public Member Functions

 BitmapFont (ObjectManager< OMT > &gl, const OMT &key)
 Construct a new bitmap font.
 ~BitmapFont ()
 Destruct this bitmap font.
bool init (const WindowSystem ws, const std::string &name, const uint32_t size=12)
 Initialize this bitmap font.
void exit ()
 De-initialize this bitmap font.
void draw (const std::string &text) const
 Draw text on the current raster position.

Detailed Description

template<class OMT>
class eq::util::BitmapFont< OMT >

A wrapper around AGL, WGL and GLX bitmap fonts.

Definition at line 34 of file bitmapFont.h.


Constructor & Destructor Documentation

template<class OMT >
eq::util::BitmapFont< OMT >::BitmapFont ( ObjectManager< OMT > &  gl,
const OMT &  key 
)

Construct a new bitmap font.

Usually bitmap fonts are allocated using ObjectManager::newEqBitmapFont, which provides the correct parameters for this constructor.

Parameters:
glAn ObjectManager to allocate display lists for the fonts
keyA unique key to allocate OpenGL objects from the object manager.
Version:
1.0

Definition at line 49 of file bitmapFont.ipp.

template<class OMT >
eq::util::BitmapFont< OMT >::~BitmapFont ( )

Destruct this bitmap font.

The destructor does not call exit, since it can't be sure there is a valid OpenGL context current.

Version:
1.0

Definition at line 58 of file bitmapFont.ipp.


Member Function Documentation

template<class OMT >
void eq::util::BitmapFont< OMT >::draw ( const std::string &  text) const

Draw text on the current raster position.

Version:
1.0

Definition at line 277 of file bitmapFont.ipp.

template<class OMT >
void eq::util::BitmapFont< OMT >::exit ( )

De-initialize this bitmap font.

Version:
1.0

Definition at line 86 of file bitmapFont.ipp.

template<class OMT >
bool eq::util::BitmapFont< OMT >::init ( const WindowSystem  ws,
const std::string &  name,
const uint32_t  size = 12 
)

Initialize this bitmap font.

The font name depends on the operating system. Please refer to your OS tools to find available fonts. If no name is given, "Times New Roman" or similar is used.

An OpenGL context needs to be current, and eq::XGetCurrentDisplay() needs to return the current display connection for GLX.

Parameters:
wsthe current window system.
namethe name of the font.
sizethe size of the font in pixels.
Version:
1.0

Definition at line 66 of file bitmapFont.ipp.

References eq::WINDOW_SYSTEM_AGL, eq::WINDOW_SYSTEM_GLX, and eq::WINDOW_SYSTEM_WGL.


The documentation for this class was generated from the following files:
Generated on Sun May 8 2011 19:11:10 for Equalizer 1.0 by  doxygen 1.7.3