X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture2darray.cpp;h=07f04c691b7dad0f9387ecd5362ece69196a6264;hb=e1be82a4dfce8d90358c506f65be09da4dc9d5ec;hp=1928d4e3503c6f68f2446125ffe4b423c96ac5fc;hpb=2b7f8e45e75bec30c1ea27fc0efd8286f67adc3f;p=libs%2Fgl.git diff --git a/source/core/texture2darray.cpp b/source/core/texture2darray.cpp index 1928d4e3..07f04c69 100644 --- a/source/core/texture2darray.cpp +++ b/source/core/texture2darray.cpp @@ -1,7 +1,4 @@ -#include -#include #include "error.h" -#include "pixelstore.h" #include "texture2darray.h" using namespace std; @@ -9,28 +6,15 @@ using namespace std; namespace Msp { namespace GL { -Texture2DArray::Texture2DArray(): - Texture3D(GL_TEXTURE_2D_ARRAY) -{ - static Require _req(EXT_texture_array); -} - void Texture2DArray::layer_image(unsigned level, unsigned z, const void *data) { - if(level>=levels || z>=depth) + if(level>=n_levels || z>=depth) throw out_of_range("Texture2DArray::layer_image"); LinAl::Vector size = get_level_size(level); sub_image(level, 0, 0, z, size.x, size.y, 1, data); } -void Texture2DArray::layer_image(unsigned level, unsigned z, PixelComponents comp, DataType type, const void *data) -{ - if(comp!=get_components(format) || type!=get_component_type(format)) - throw incompatible_data("Texture2DArray::layer_image"); - layer_image(level, z, data); -} - void Texture2DArray::layer_image(unsigned level, unsigned z, const Graphics::Image &img) { if(!get_width()) @@ -44,9 +28,6 @@ void Texture2DArray::layer_image(unsigned level, unsigned z, const Graphics::Ima if(get_components(fmt)!=get_components(format) || get_component_type(fmt)!=get_component_type(format)) throw incompatible_data("Texture2DArray::layer_image"); - PixelStore pstore = PixelStore::from_image(img); - BindRestore _bind_ps(pstore); - layer_image(level, z, img.get_pixels()); }