Files Classes Functions Hierarchy
#include <textoverlay.h>
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. | |
Definition at line 20 of file textoverlay.h.
| textoverlay::textoverlay | ( | ) |
| 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 | ( | ) |
Turn lighting off so text is visible, then restore the previous state.
Definition at line 35 of file textoverlay.cpp.
References drawpost, drawpre, gobjContainerdeque::push_back(), and gobjContainerdeque::push_front().
Referenced by maze005::menubuild(), menusystemtest01::menusystemtest01(), menusystemtest04::menusystemtest04(), simplexD1tessapp01::messagemenu(), simplexD2tessapp01::test02(), delaunaysimpleD2test::test02(), and treeindexedD2test::test05().
00036 { 00037 drawpre.push_back(new gobjglPushAttrib(GL_CURRENT_BIT)); 00038 drawpre.push_back(new gobjglPushAttrib(GL_LIGHTING)); 00039 00040 drawpre.push_back(new gobjglDisable(GL_LIGHTING)); 00041 00042 drawpost.push_front(new gobjglPopAttrib()); 00043 drawpost.push_front(new gobjglPopAttrib()); 00044 }
| 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 }
| double textoverlay::bottom |
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().
| double textoverlay::left |
The left coordinate in 2D window.
Definition at line 25 of file textoverlay.h.
Referenced by init().
| double textoverlay::right |
The right coordinate in 2D window.
Definition at line 27 of file textoverlay.h.
Referenced by init().
| double textoverlay::top |
1.5.8