include/font.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *            font.h
00003  *
00004  *  Sun Sep 26 13:33:51 2004
00005  *  Copyright  2004  Joe Venzon
00006  *  joe@venzon.net
00007  ****************************************************************************/
00008 
00009 /*
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00023  */
00024  
00025 #ifndef _FONT_H
00026 
00027 #include <stdio.h>
00028 #include <GL/gl.h>
00029 #include <GL/glu.h>
00030 #include <SDL/SDL.h>
00031 #include <string>
00032 #include <iostream>
00033 #include <fstream>
00034 
00035 #include "utility.h"
00036 #include "textures.h"
00037 #include "settings.h"
00038 #include "globals.h"
00039 
00040 using namespace std;
00041 
00042 class FONT
00043 {
00044 private:
00045         GLuint base;
00046         TEXTURE_HANDLE texture;
00047 
00048         ofstream error_log;
00049 
00050         int spacing[2][128];
00051 
00052         bool loaded;
00053 
00054         void GetSizing(int size, int & sx, int & sy);
00055         
00056 public:
00057         FONT();
00058         ~FONT();
00059         void Load();
00060         void Print( float px, float py, const char *string, int set, int size, float opacity );
00061         void Print( float px, float py, const char *string, int set, int size, float r, float g, float b );
00062         void Print( float px, float py, const char *string, int set, int size, float r, float g, float b, float trans );
00063 
00064         float Width(const char * str, int set, int size);
00065         float Height(const char * str, int set, int size);
00066 };
00067 
00068 #define _FONT_H
00069 #endif /* _FONT_H */

Generated on Thu Oct 19 04:05:47 2006 by  doxygen 1.4.6