]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture3d.cpp
Allow the maximum mipmap level of a texture to be specified
[libs/gl.git] / source / texture3d.cpp
index 36fdfa0f3b8f6b591fd19b7f4d4047fa45c0ba06..ed5619cb4aed30f567cf7e3e063a7ad05f60fd27 100644 (file)
@@ -188,7 +188,7 @@ void Texture3D::image(const Graphics::Image &img, bool srgb)
        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, d, l);
        }
        else if(w!=width || h!=height || d!=depth)