]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture3d.cpp
Remove the deprecated ProgramBuilder class
[libs/gl.git] / source / texture3d.cpp
index 13bb3ff41a4ce99164a7443406a3eb3f4ac0bf50..03c58d0afdf05e6273cfbbea2892ea2d7e067ca9 100644 (file)
@@ -138,37 +138,26 @@ void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsi
        sub_image(level, x, y, z, wd, ht, dp, data);
 }
 
-void Texture3D::image(const Graphics::Image &img, unsigned lv, bool srgb)
+void Texture3D::image(const Graphics::Image &img, unsigned lv)
 {
        unsigned w = img.get_width();
        unsigned h = img.get_height();
-       unsigned d = 1;
 
-       if(depth)
-       {
-               if(h%depth)
-                       throw incompatible_data("Texture3D::load_image");
-               h /= depth;
-               d = depth;
-       }
-       else
-       {
-               if(h%w)
-                       throw incompatible_data("Texture3D::load_image");
-               d = h/w;
-               h = w;
-       }
+       if(h%w)
+               throw incompatible_data("Texture3D::load_image");
+       unsigned d = h/w;
+       h = w;
 
        PixelFormat fmt = pixelformat_from_image(img);
        if(width==0)
-               storage(make_pixelformat(get_components(fmt), get_component_type(fmt), srgb), w, h, d, lv);
+               storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, h, d, lv);
        else if(w!=width || h!=height || d!=depth)
                throw incompatible_data("Texture3D::load_image");
 
        PixelStore pstore = PixelStore::from_image(img);
        BindRestore _bind_ps(pstore);
 
-       image(0, img.get_data());
+       image(0, img.get_pixels());
 }
 
 unsigned Texture3D::get_n_levels() const