]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pixelstore.cpp
Remove the deprecated ProgramBuilder class
[libs/gl.git] / source / pixelstore.cpp
index 629162cd890b1a9dfd760bc47ddc60a41ef784a9..409f0f9a862e3582c975a486188452a60544dfb6 100644 (file)
@@ -1,5 +1,6 @@
 #include <algorithm>
 #include <msp/gl/extensions/ext_texture3d.h>
+#include <msp/gl/extensions/ext_unpack_subimage.h>
 #include "gl.h"
 #include "pixelformat.h"
 #include "pixelstore.h"
@@ -22,7 +23,7 @@ PixelStore PixelStore::from_image(const Graphics::Image &img)
 {
        PixelStore pstore;
        unsigned stride = img.get_stride();
-       unsigned ncomp = get_component_count(pixelformat_from_graphics(img.get_format()));
+       unsigned ncomp = get_component_count(pixelformat_from_image(img));
        pstore.set_canvas_size(img.get_stride()/ncomp, 0);
        pstore.set_alignment(min(stride&~(stride-1), 8U));
        return pstore;
@@ -52,6 +53,7 @@ void PixelStore::update_parameter(int mask) const
 
 void PixelStore::set_canvas_size(unsigned w, unsigned h)
 {
+       static Require _req(EXT_unpack_subimage);
        row_length = w;
        image_height = h;
        update_parameter(SIZE);
@@ -59,6 +61,7 @@ void PixelStore::set_canvas_size(unsigned w, unsigned h)
 
 void PixelStore::set_origin(unsigned x, unsigned y, unsigned z)
 {
+       static Require _req(EXT_unpack_subimage);
        if(z>0)
                static Require _req3d(EXT_texture3D);
        skip_pixels = x;