]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Have Object provide an identity matrix from get_matrix
[libs/gl.git] / source / texture2d.cpp
index 44ee6406420e85f261c988f5e8b14f678c90cfe3..45c2e665d056973ee4ecdb41eb6033dd831c2b5b 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)