font.h

00001 /*
00002 * "PS2" Application Framework
00003 *
00004 * University of Abertay Dundee
00005 * May be used for educational purposed only
00006 *
00007 * Author - Dr Henry S Fortuna
00008 *
00009 * $Revision: 1.2 $
00010 * $Date: 2007/08/19 12:45:10 $
00011 *
00012 */
00013 
00014 #ifndef __FONT_H__
00015 #define __FONT_H__
00016 
00017 #include "dma.h"
00018 #include <stdio.h>
00019 #include <stdarg.h>
00020 
00021 class CFont
00022 {
00023 public:
00024         CFont();
00025         ~CFont();
00026 
00027         bool Load(const char * strWidths, bool DoubleHeight = false);
00028 
00029         // (L)eft, (R)ight, and (C)entered font rendering functions
00030         void RenderL(const int x, const int y, const char * strText, 
00031                                 uint8 R = 0x80, uint8 G = 0x80, uint8 B = 0x80, uint8 A = 0x80);
00032         void RenderR(const int x, const int y, const char * strText, 
00033                                 uint8 R = 0x80, uint8 G = 0x80, uint8 B = 0x80, uint8 A = 0x80);
00034         void RenderC(const int x, const int y, const char * strText, 
00035                                 uint8 R = 0x80, uint8 G = 0x80, uint8 B = 0x80, uint8 A = 0x80);
00036 
00037         // (L)eft, (R)ight, and (C)entered font rendering functions, with variable arguments.
00038         void printfL(const int x, const int y, uint8 R, uint8 G, uint8 B, uint8 A, const char * strText, ...);
00039         void printfR(const int x, const int y, uint8 R, uint8 G, uint8 B, uint8 A, const char * strText, ...);
00040         void printfC(const int x, const int y, uint8 R, uint8 G, uint8 B, uint8 A, const char * strText, ...);
00041 
00042         int GetStringWidth(const char * strText);
00043 
00044 protected:
00045         unsigned char * m_FontWidths;
00046         bool m_DoubleHeight;
00047 };
00048 
00049 #endif

Generated on Sun May 18 21:45:08 2008 for PS2X by  doxygen 1.5.4