From 4a577ddc946bd279d7bc4942a2ce4c46c7ef5d35 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 28 Oct 2016 01:38:34 +0300 Subject: [PATCH] Implement sub_image for TextureCube also I thought it was already implemented but in turned out there was only a declaration. --- source/texturecube.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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(); -- 2.45.2