Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/render/Font.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _FONT_H_
00004 #define _FONT_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <resource/Resource.h>
00009 
00010 #include <string>
00011 
00012 namespace resource
00013 {
00014 class Serializer;
00015 }
00016 
00017 namespace render
00018 {
00019 
00020 class Material;
00021 
00022 // Allow 8-bit ASCII 
00023 // Only chars 33+ are any use though
00024 #define GAME_NUM_CHARS (256 - 32)
00025 // How to look up chars
00026 #define GAME_CHAR_INDEX(c) c - 33
00027 
00028 enum FontType
00029 {
00030         FT_TRUETYPE,    
00031         FT_IMAGE,               
00032         FT_COUNT
00033 };
00034 
00039 class ENGINE_PUBLIC_EXPORT Font: public resource::Resource
00040 {
00041 public:
00042 
00043         Font(const std::string& name, resource::Serializer* serializer);
00044         ~Font();
00045 
00047         void setMaterial(const std::string& filename);
00048         void setMaterial(Material* material);
00049 
00050         Material* getMaterial() const;
00051 
00052         void setCharTexCoords(c8 id, f32 u1, f32 v1, f32 u2, f32 v2);
00053 
00054         void getCharTexCoords(c8 id, f32& u1, f32& v1, f32& u2, f32& v2) const;
00055         
00056         f32 getCharAspectRatio(c8 id) const;
00057 
00058 protected:
00059 
00060         void initProperties();
00061 
00062         Material* mMaterial;
00063 
00065         f32 mTexCoordsU1[GAME_NUM_CHARS];
00067         f32 mTexCoordsU2[GAME_NUM_CHARS];
00069         f32 mTexCoordsV1[GAME_NUM_CHARS];
00071         f32 mTexCoordsV2[GAME_NUM_CHARS];
00072 
00074         f32 mAspectRatio[GAME_NUM_CHARS];
00075 };
00076 
00077 } //namespace render
00078 
00079 #endif

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:04 by Doxygen (1.7.4)