X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpixelstore.cpp;h=e1a7cc0ef9ea378bce5db24f7035500b00829a36;hp=011866e3e72410a44031a0b154367c621bebb44f;hb=133fe7352831197c9ec59f923c1126651d80edcb;hpb=126161d1d44ab9503bc747d24a07b7b9d15e527a diff --git a/source/pixelstore.cpp b/source/pixelstore.cpp index 011866e3..e1a7cc0e 100644 --- a/source/pixelstore.cpp +++ b/source/pixelstore.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include "gl.h" #include "pixelformat.h" #include "pixelstore.h" @@ -35,13 +37,15 @@ void PixelStore::update_parameter(int mask) const if(mask&SIZE) { glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length); - glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, image_height); + if(EXT_texture3D) + glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, image_height); } if(mask&ORIGIN) { glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels); glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows); - glPixelStorei(GL_UNPACK_SKIP_IMAGES, skip_images); + if(EXT_texture3D) + glPixelStorei(GL_UNPACK_SKIP_IMAGES, skip_images); } if(mask&ALIGNMENT) glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); @@ -49,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); @@ -56,6 +61,9 @@ 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; skip_rows = y; skip_images = z;