]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.h
Support linear to sRGB conversion when loading materials and textures
[libs/gl.git] / source / texture2d.h
index 6c089ed2fc675c27ed40edf9d07f85cffe1dd019..dce58a7873213e772381582e490c11363f8557b6 100644 (file)
@@ -22,7 +22,10 @@ public:
        {
        public:
                Loader(Texture2D &);
+               Loader(Texture2D &, Collection &);
        private:
+               void init();
+
                void image_data(const std::string &);
                void raw_data(const std::string &);
                void storage(PixelFormat, unsigned, unsigned);
@@ -60,12 +63,12 @@ public:
        /** Loads an image from a file and uploads it to the texture.  If storage
        has not been defined, it will be set to match the loaded image.  Otherwise
        the image must be compatible with the defined storage. */
-       void load_image(const std::string &fn);
+       void load_image(const std::string &fn, bool srgb = false);
 
        /** Uploads an image to the texture.  If storage has not been defined, it
        will be set to match the image.  Otherwise the image must be compatible with
        the defined storage. */
-       void image(const Graphics::Image &);
+       void image(const Graphics::Image &, bool srgb = false);
 
        unsigned get_width() const { return width; }
        unsigned get_height() const { return height; }