1 #ifndef MSP_GL_RESOURCES_H_
2 #define MSP_GL_RESOURCES_H_
4 #include <msp/datafile/collection.h>
13 class ResourceManager;
17 A collection class for GL resources. Most useful as a base class for an
18 application-specific collection.
20 class Resources: virtual public DataFile::Collection
23 TextureFilter default_tex_filter;
24 float default_tex_anisotropy;
26 ResourceManager *resource_manager;
31 static const DataFile::CollectionSource &get_builtins();
33 void set_default_texture_filter(TextureFilter);
34 void set_default_texture_anisotropy(float);
36 /** Enables or disables sRGB conversion. If enabled, textures and material
37 colors are converted from sRGB to linear color space when loaded. */
38 void set_srgb_conversion(bool);
40 bool get_srgb_conversion() const { return srgb_conversion; }
42 void set_resource_manager(ResourceManager *);
45 Material *create_material(const std::string &);
46 Mesh *create_mesh(const std::string &);
47 Texture2D *create_texture2d(const std::string &);
48 Program *create_program(const std::string &);