// Description: // Just like a Bitmap Collection but tailored for a bitmap font. // // Copyright (C) 2001 Frank Becker // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 2 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details // #include #include #include //Draw a string at (x,y) scaled by [scalex,scaley] void GLBitmapFont::DrawString( const char *s, float x, float y, float scalex, float scaley) { XTRACE(); unsigned char c; int i, l; l=(int)strlen(s); glEnable(GL_TEXTURE_2D); _bitmapCollection->bind(); glBegin(GL_QUADS); for (i=0; i_totalHeight) { _totalHeight = height; } //provide mapping for char -> _bitmapInfo index _charInfo[ (int)_bitmapInfo[ i].name[0]] = i; } //add a little extra space... _totalHeight += 2; return result; }