]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Add more public methods to Transform
[libs/gl.git] / source / texture2d.cpp
index 44ee6406420e85f261c988f5e8b14f678c90cfe3..806e4a179bded9f8a71264ecce78bccafc529870 100644 (file)
@@ -141,7 +141,7 @@ void Texture2D::image(const Graphics::Image &img, bool srgb, bool from_buffer)
        PixelFormat fmt = pixelformat_from_graphics(img.get_format());
        if(width==0)
        {
-               unsigned l = (is_mipmapped(min_filter) ? 0 : 1);
+               unsigned l = (is_mipmapped(min_filter) ? mipmap_levels ? mipmap_levels : 0 : 1);
                storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h, l);
        }
        else if(w!=width || h!=height)
@@ -218,8 +218,6 @@ void Texture2D::Loader::raw_data(const string &data)
 
 void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h)
 {
-       if(srgb)
-               fmt = get_srgb_pixelformat(fmt);
        obj.storage(fmt, w, h);
 }