]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Move srgb handling to storage_pixelformat_from_graphics
[libs/gl.git] / source / texture2d.cpp
index 64ad124f97a1952f19307d429c8f9acd427d76c1..d435a356a9ef3f215c6f11d912e1c76fade17959 100644 (file)
@@ -118,12 +118,7 @@ void Texture2D::image(const Graphics::Image &img, bool srgb, bool from_buffer)
        unsigned h = img.get_height();
        PixelFormat fmt = pixelformat_from_graphics(img.get_format());
        if(width==0)
-       {
-               PixelFormat f = storage_pixelformat_from_graphics(img.get_format());
-               if(srgb)
-                       f = get_srgb_pixelformat(f);
-               storage(f, w, h);
-       }
+               storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h);
        else if(w!=width || h!=height)
                throw incompatible_data("Texture2D::image");