]> git.tdb.fi Git - libs/gltk.git/blob - source/resources.h
Fix automatic font creation
[libs/gltk.git] / source / resources.h
1 #ifndef MSP_GLTK_RESOURCES_H_
2 #define MSP_GLTK_RESOURCES_H_
3
4 #include <msp/gl/font.h>
5 #include <msp/gl/texture.h>
6 #include <msp/datafile/collection.h>
7 #include <msp/path/path.h>
8 #include "graphic.h"
9 #include "style.h"
10
11 namespace Msp {
12 namespace GLtk {
13
14 class Resources: public DataFile::Collection
15 {
16 private:
17         Path path;
18         GL::Font *default_font;
19
20 public:
21         class Loader: public Collection::Loader
22         {
23         private:
24                 Resources &res;
25
26         public:
27                 Loader(Resources &);
28         private:
29                 void default_font(const std::string &);
30                 void font(const std::string &);
31         };
32
33         Resources();
34
35         void set_path(const Path &);
36         const GL::Font &get_default_font() const;
37 private:
38         GL::Font *create_font(const std::string &);
39         GL::Texture2D *create_texture(const std::string &);
40 };
41
42 } // namespace GLtk
43 } // namespace Msp
44
45 #endif