1 #ifndef MSP_GL_RESOURCES_H_
2 #define MSP_GL_RESOURCES_H_
4 #include <msp/datafile/builtinsource.h>
5 #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;
25 ResourceManager *resource_manager;
31 static DataFile::BuiltinSource &get_builtins();
34 void set_default_texture_filter(TextureFilter);
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 Mesh *create_mesh(const std::string &);
46 Texture2D *create_texture2d(const std::string &);
47 Program *create_program(const std::string &);