]> git.tdb.fi Git - libs/gl.git/blob - source/resources.h
Improve interface documentation a bit
[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 Texture2D;
11
12 /**
13 A collection class for GL resources.  Most useful as a base class for an
14 application-specific collection.
15 */
16 class Resources: virtual public DataFile::Collection
17 {
18 private:
19         TextureFilter default_tex_filter;
20         bool srgb_conversion;
21
22 public:
23         Resources();
24
25         void set_default_texture_filter(TextureFilter);
26
27         /** Enables or disables sRGB conversion.  If enabled, textures and material
28         colors are converted from sRGB to linear color space when loaded. */
29         void set_srgb_conversion(bool);
30
31         bool get_srgb_conversion() const { return srgb_conversion; }
32
33 protected:
34         Texture2D *create_texture2d(const std::string &);
35 };
36
37 } // namespace GL
38 } // namespace Msp
39
40 #endif