]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture2d.cpp
Add an srgb flag to pixelformat_from_image
[libs/gl.git] / source / core / texture2d.cpp
index 31d7016574b17ecdf3200d587f781d940914d21e..703b719a211f6390c78f35aacfe9f12a9c07701b 100644 (file)
@@ -120,11 +120,7 @@ void Texture2D::image(const Graphics::Image &img, unsigned lv)
 
 void Texture2D::image(const Graphics::Image &img, unsigned lv, bool from_buffer)
 {
-       unsigned w = img.get_width();
-       unsigned h = img.get_height();
-       PixelFormat fmt = pixelformat_from_image(img);
-       storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, h, lv);
-
+       storage(pixelformat_from_image(img, use_srgb_format), img.get_width(), img.get_height(), lv);
        image(0, from_buffer ? 0 : img.get_pixels());
 }