proj home

Files   Classes   Functions   Hierarchy  

namefont Class Reference

Primitive text drawing class using Glut. More...

#include <menusystem.h>

Inheritance diagram for namefont:
Collaboration diagram for namefont:

List of all members.

Public Member Functions

 namefont (point2< GLint > const &X_, stringc &name_, void *font_=GLUT_BITMAP_HELVETICA_10)
 The choices of font are GLUT_BITMAP_{HELVETICA_10, HELVETICA_12, HELVETICA_18, 8_BY_13, 9_BY_15, TIMES_ROMAN_10, TIMES_ROMAN_24 }.
void draw ()
 Draw the text at position X.

Public Attributes

point2< GLint > X
 Current position.
string name
 The string being displayed.
void * font
 The glut font being pointed to.


Detailed Description

Primitive text drawing class using Glut.

Holds the string being printed, the font being used, the position to print and has the drawing function.

Definition at line 26 of file menusystem.h.


Constructor & Destructor Documentation

namefont::namefont ( point2< GLint > const &  X_,
stringc name_,
void *  font_ = GLUT_BITMAP_HELVETICA_10 
)

The choices of font are GLUT_BITMAP_{HELVETICA_10, HELVETICA_12, HELVETICA_18, 8_BY_13, 9_BY_15, TIMES_ROMAN_10, TIMES_ROMAN_24 }.

Definition at line 9 of file menusystem.cpp.

00014   : X(X_), name(name_), font(font_) 
00015 {
00016 }


Member Function Documentation

void namefont::draw (  )  [virtual]

Draw the text at position X.

Implements gobj.

Definition at line 19 of file menusystem.cpp.

References font, GOBJDEBUGCODE, name, point2< T >::x, X, and point2< T >::y.

00020 {
00021   GOBJDEBUGCODE
00022   assert(font!=0);
00023 
00024   glRasterPos2i(X.x,X.y);
00025   uintc kmax = name.size();
00026   for (uint k=0; k<kmax; ++k)
00027     glutBitmapCharacter(font, name[k]);
00028 }


Member Data Documentation

The glut font being pointed to.

Definition at line 35 of file menusystem.h.

Referenced by draw().

The string being displayed.

Definition at line 33 of file menusystem.h.

Referenced by draw().

Current position.

Definition at line 31 of file menusystem.h.

Referenced by draw().


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:07 2011 for Chelton Evans Source by  doxygen 1.5.8