]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturecube.cpp
Allow the maximum mipmap level of a texture to be specified
[libs/gl.git] / source / texturecube.cpp
index ee8c71c5b0399e88f7c15b375878cf64623a4472..03e65167d73fee7a1d89ba9ea3cea7ef2c68d81d 100644 (file)
@@ -161,7 +161,7 @@ void TextureCube::image(const Graphics::Image &img, bool srgb)
        PixelFormat fmt = pixelformat_from_graphics(img.get_format());
        if(size==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, l);
        }
        else if(w!=size || h!=size)