1 //==============================================================================
2 // This program is free software; you can redistribute it and/or modify
3 // it under the terms of the GNU General Public License as published by
4 // the Free Software Foundation; either version 2 of the License, or
5 // (at your option) any later version.
6 //
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 // GNU Library General Public License for more details.
11 //
12 // You should have received a copy of the GNU General Public License
13 // along with this program; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 //==============================================================================
16 
17 //==============================================================================
18 // File: cTextureFont.hpp
19 // Project: Shooting Star
20 // Author: Jarmo Hekkanen <jarski@2ndpoint.fi>
21 // Copyrights (c) 2003 2ndPoint ry (www.2ndpoint.fi)
22 //------------------------------------------------------------------------------
23 // Revision history
24 //==============================================================================
25 #ifndef cTextureFont_hpp
26 #define cTextureFont_hpp
27 //==============================================================================
28 // Includes
29 #include "Types.hpp"
30 #include <string>
31 //------------------------------------------------------------------------------
32 // Namespaces
33 using namespace std;
34 namespace ShootingStar {
35 //------------------------------------------------------------------------------
36 // Forward declarations
37 //==============================================================================
38 
39 //! TextureFont
40 class cTextureFont
41 {
42 	// Constructor & Destructor
43 	public:
44 		//! Constructor
45 		cTextureFont (void);
46 		//! Constructor
47 		cTextureFont (string filename, int width, int height);
48 		//! Destructor
49 		~cTextureFont (void);
50 
51 	// Public methods
52 	public:
53 		//! Initialize font
54 		void Initialize (string filename, int width, int height);
55 		//! Print string
56 		void PrintString (string text);
57 		//! Print formatted string
58 		void Print (const char *pFormat, ...);
59 
60 		//! Print string with wave effect
61 		void PrintStringW (string text, float a = 0.0f, float deltaA = 0.5f);
62 
63 	// Private methods
64 	private:
65 		void MakeDisplayLists (int texWidth, int texHeight);
66 
67 	// Member variables
68 	private:
69 		Uint32 mTexture;
70 		Uint32 mListBase;
71 		int mWidth;
72 		int mHeight;
73 };
74 
75 //==============================================================================
76 }		// End of the ShootingStar namespace
77 #endif // cTextureFont_hpp
78 //------------------------------------------------------------------------------
79 // EOF
80 //==============================================================================
81