proj home

Files   Classes   Functions   Hierarchy  

textoverlay Class Reference

#include <textoverlay.h>

Inheritance diagram for textoverlay:
Collaboration diagram for textoverlay:

List of all members.

Public Member Functions

 textoverlay (doublec left_, doublec right_, doublec bottom_, doublec top_)
 Constructor takes arguments for gluOrtho2D called in drawPre.draw().
 textoverlay ()
 Constructor.
void init ()
 Shared constructor code.
virtual void draw ()=0
 Overload and insert your text commands.
void printstring (void *font, string const &s) const
 Write a string to the projection winodow.
void lightingdisable ()
 Turn lighting off so text is visible, then restore the previous state.

Public Attributes

double left
 The left coordinate in 2D window.
double right
 The right coordinate in 2D window.
double bottom
 The bottom coordinate in 2D window.
double top
 The top coordinate in 2D window.
gobjContainerdeque drawpre
 Call inside draw() drawpre.draw() at the start before writing.
gobjContainerdeque drawpost
 Call inside draw() drawpre.draw() at the end after writing.


Detailed Description

Definition at line 20 of file textoverlay.h.


Constructor & Destructor Documentation

textoverlay::textoverlay ( doublec  left_,
doublec  right_,
doublec  bottom_,
doublec  top_ 
)

Constructor takes arguments for gluOrtho2D called in drawPre.draw().

Definition at line 4 of file textoverlay.cpp.

References init().

00010   : left(left_), right(right_), bottom(bottom_), 
00011     top(top_), drawpre(true), drawpost(true)
00012 {
00013   init();
00014 }

textoverlay::textoverlay (  ) 

Constructor.

Definition at line 16 of file textoverlay.cpp.

References init().

00017   : left(-0.5), right(639.5), bottom(479.5), 
00018     top(-1.0), drawpre(true), drawpost(true)
00019 {
00020   init();
00021 }


Member Function Documentation

virtual void textoverlay::draw (  )  [pure virtual]

Overload and insert your text commands.

Implements gobj.

Implemented in menu01< T >, cubedraw2d, menusystem, menusystemOneShot, menusystemsave01, and menu01< test01obj< P, PD > >.

void textoverlay::init (  ) 

Shared constructor code.

Definition at line 47 of file textoverlay.cpp.

References bottom, drawpost, drawpre, left, gobjContainerdeque::nuke(), gobjContainerdeque::push_back(), right, and top.

Referenced by textoverlay().

00048 {
00049   drawpre.nuke();
00050   drawpost.nuke();
00051 
00052   // assuming GL_MODELVIEW mode
00053   drawpre.push_back(new gobjglPushMatrix());  // save
00054   drawpre.push_back(new gobjglLoadIdentity());  // clear
00055 
00056   drawpre.push_back(new gobjglMatrixMode(GL_PROJECTION));
00057   drawpre.push_back(new gobjglPushMatrix()); // save
00058   drawpre.push_back(new gobjglLoadIdentity());  // clear
00059 
00060   drawpre.push_back(new gobjgluOrtho2D(left,right,bottom,top));
00061   drawpre.push_back(new gobjglMatrixMode(GL_MODELVIEW));
00062 
00063 
00064   drawpost.push_back(new gobjglMatrixMode(GL_PROJECTION));
00065   drawpost.push_back(new gobjglPopMatrix());  // restore
00066   drawpost.push_back(new gobjglMatrixMode(GL_MODELVIEW));
00067   drawpost.push_back(new gobjglPopMatrix());  // restore
00068 }

void textoverlay::lightingdisable (  ) 

void textoverlay::printstring ( void *  font,
string const &  s 
) const

Write a string to the projection winodow.

Definition at line 24 of file textoverlay.cpp.

00028 {
00029 //cout << "*" << s << "*" << endl;
00030   uint len = s.size();
00031   for (uint i=0; i<len; ++i)
00032     glutBitmapCharacter(font,s[i]);
00033 }


Member Data Documentation

The bottom coordinate in 2D window.

Definition at line 29 of file textoverlay.h.

Referenced by init().

Call inside draw() drawpre.draw() at the end after writing.

Definition at line 58 of file textoverlay.h.

Referenced by menusystem::draw(), menusystem::drawparentsnested(), menusystem::fontcolorenable(), init(), and lightingdisable().

Call inside draw() drawpre.draw() at the start before writing.

Definition at line 55 of file textoverlay.h.

Referenced by menusystem::draw(), menusystem::fontcolorenable(), init(), lightingdisable(), and menusystemtest04::menusystemtest04().

The left coordinate in 2D window.

Definition at line 25 of file textoverlay.h.

Referenced by init().

The right coordinate in 2D window.

Definition at line 27 of file textoverlay.h.

Referenced by init().

The top coordinate in 2D window.

Definition at line 31 of file textoverlay.h.

Referenced by init().


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

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