1 #include <msp/fs/utils.h>
9 Resources::Resources():
12 add_type<Graphic>().keyword("graphic");
13 add_type<GL::Texture2D>().keyword("texture");
14 add_type<GL::Font>().keyword("font");
15 add_type<Style>().keyword("style");
18 const GL::Font &Resources::get_default_font() const
21 throw logic_error("!default_font");
27 Resources::Loader::Loader(Resources &r):
28 Collection::Loader(r),
31 add("default_font", &Loader::default_font);
32 add("font", &Loader::font);
35 void Resources::Loader::default_font(const string &name)
37 res.default_font = &res.get<GL::Font>(name);
40 void Resources::Loader::font(const string &name)
42 RefPtr<GL::Font> fnt = new GL::Font;
44 res.add(name, fnt.get());
46 res.default_font = fnt.get();