-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include <msp/core/except.h>
#include <msp/fs/utils.h>
#include "resources.h"
void Resources::init()
{
- add_keyword<Graphic>("graphic");
- add_keyword<GL::Texture2D>("texture");
-
- add_creator(&Resources::create_font);
- add_creator(&Resources::create_texture);
+ add_type<Graphic>().keyword("graphic");
+ add_type<GL::Texture2D>().keyword("texture").creator(&Resources::create_texture);
+ add_type<GL::Font>().creator(&Resources::create_font);
}
void Resources::set_path(const FS::Path &p)
const GL::Font &Resources::get_default_font() const
{
if(!default_font)
- throw InvalidState("No default font");
+ throw logic_error("!default_font");
return *default_font;
}
void Resources::Loader::default_font(const string &name)
{
- res.default_font = res.get<GL::Font>(name);
+ res.default_font = &res.get<GL::Font>(name);
}
void Resources::Loader::font(const string &name)