From: Mikko Rasa Date: Thu, 27 Oct 2016 22:38:34 +0000 (+0300) Subject: Implement sub_image for TextureCube also X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4a577ddc946bd279d7bc4942a2ce4c46c7ef5d35;p=libs%2Fgl.git Implement sub_image for TextureCube also I thought it was already implemented but in turned out there was only a declaration. --- diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 889d051b..26402695 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -80,6 +80,17 @@ void TextureCube::image(TextureCubeFace face, unsigned level, PixelFormat fmt, D } } +void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y, unsigned wd, unsigned ht, PixelFormat fmt, DataType type, const void *data) +{ + if(size==0) + throw invalid_operation("TextureCube::sub_image"); + + allocate(level); + + BindRestore _bind(this); + glTexSubImage2D(face, level, x, y, wd, ht, fmt, type, data); +} + void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool srgb) { unsigned w = img.get_width();