]> git.tdb.fi Git - libs/gl.git/blob - source/resources.h
Remove the deprecated ProgramBuilder class
[libs/gl.git] / source / resources.h
1 #ifndef MSP_GL_RESOURCES_H_
2 #define MSP_GL_RESOURCES_H_
3
4 #include <msp/datafile/collection.h>
5 #include "texture.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class Material;
11 class Mesh;
12 class Program;
13 class ResourceManager;
14 class Texture2D;
15
16 /**
17 A collection class for GL resources.  Most useful as a base class for an
18 application-specific collection.
19 */
20 class Resources: virtual public DataFile::Collection
21 {
22 private:
23         TextureFilter default_tex_filter;
24         float default_tex_anisotropy;
25         bool srgb_conversion;
26         ResourceManager *resource_manager;
27
28 public:
29         Resources();
30
31         static const DataFile::CollectionSource &get_builtins();
32
33         void set_default_texture_filter(TextureFilter);
34         void set_default_texture_anisotropy(float);
35
36         /** Enables or disables sRGB conversion.  If enabled, textures and material
37         colors are converted from sRGB to linear color space when loaded. */
38         DEPRECATED void set_srgb_conversion(bool);
39
40         DEPRECATED bool get_srgb_conversion() const { return srgb_conversion; }
41
42         void set_resource_manager(ResourceManager *);
43
44 protected:
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 &);
49 };
50
51 } // namespace GL
52 } // namespace Msp
53
54 #endif