Game Develop C++ Platform: FontManager.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
FontManager.h
Go to the documentation of this file.
1
6 #ifndef FONTMANAGER_H
7 #define FONTMANAGER_H
8 #include <SFML/Graphics.hpp>
9 #include <string>
10 #include <vector>
11
17 class GD_API FontManager
18 {
19 public:
20
29 const sf::Font * GetFont(const std::string & fontName);
30
34 void UnloadAllFonts();
35
39 static FontManager *GetInstance()
40 {
41 if ( NULL == _singleton )
42 {
43 _singleton = new FontManager;
44 }
45
46 return ( static_cast<FontManager*>( _singleton ) );
47 }
48
52 static void DestroySingleton();
53
54 private:
55
56 void EnsureDefaultFontIsLoaded();
57
58 std::map < std::string, sf::Font* > fonts;
59 sf::Font * defaultFont;
60
61 FontManager() : defaultFont(NULL) {};
62 virtual ~FontManager();
63
64 static FontManager *_singleton;
65
66 };
67
68 #endif // FONTMANAGER_H
69