summaryrefslogtreecommitdiff
path: root/common/texfont.h
diff options
context:
space:
mode:
authorleo2002-03-10 03:24:36 +0000
committerleo2002-03-10 03:24:36 +0000
commit881162593c5aff96ec559a3526c7647197ddee81 (patch)
treedeab302a975ba912573c6f8bd591f794c8290052 /common/texfont.h
parent4470ba0ac09a6c4e0ef85b03c29834c542d00564 (diff)
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
Diffstat (limited to 'common/texfont.h')
-rw-r--r--common/texfont.h32
1 files changed, 32 insertions, 0 deletions
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_