1 #ifndef MSP_GL_RESOURCES_H_
2 #define MSP_GL_RESOURCES_H_
4 #include <msp/datafile/collection.h>
14 class ResourceManager;
19 A collection class for GL resources. Most useful as a base class for an
20 application-specific collection.
22 class Resources: virtual public DataFile::Collection
25 class Loader: public DataFile::DerivedObjectLoader<Resources, Collection::Loader>
31 void scene(const std::string &);
36 ResourceManager *resource_manager;
38 static Resources *global_resources;
41 Resources(bool = true);
44 static Resources &get_global();
45 static const DataFile::CollectionSource &get_builtins();
47 /** Enables or disables sRGB conversion. If enabled, textures and material
48 colors are converted from sRGB to linear color space when loaded. */
49 DEPRECATED void set_srgb_conversion(bool);
51 DEPRECATED bool get_srgb_conversion() const { return srgb_conversion; }
53 void set_resource_manager(ResourceManager *);
56 Material *create_material(const std::string &);
57 Mesh *create_mesh(const std::string &);
58 Scene *create_scene(const std::string &);
59 Texture2D *create_texture2d(const std::string &);
60 Module *create_module(const std::string &);
61 Program *create_program(const std::string &);
64 void set_debug_name(const std::string &, T &);