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