From 881162593c5aff96ec559a3526c7647197ddee81 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 10 Mar 2002 03:24:36 +0000 Subject: Moved the texture font to a class to allow support for multiple fonts. git-svn-id: http://svn.leocad.org/trunk@280 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/texfont.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 common/texfont.h (limited to 'common/texfont.h') diff --git a/common/texfont.h b/common/texfont.h new file mode 100644 index 0000000..e3dc185 --- /dev/null +++ b/common/texfont.h @@ -0,0 +1,32 @@ +#ifndef _TEXFONT_H_ +#define _TEXFONT_H_ + +class File; +class Texture; + +class TexFont +{ +public: + TexFont (); + ~TexFont (); + + bool IsLoaded () const + { return m_bLoaded; } + + bool FileLoad (File& file); + void PrintText (float left, float top, const char* text) const; + void PrintCharScaled (float scale, char ch) const; + +protected: + struct + { + unsigned char width; + float left, right, top, bottom; + } m_Glyphs[256]; + + Texture* m_pTexture; + unsigned char m_nFontHeight; + bool m_bLoaded; +}; + +#endif // _TEXFONT_H_ -- cgit v1.2.3