X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexturecube.cpp;h=26402695880dc12eba847ccb443fa8cb90fbb02c;hb=4a577ddc946bd279d7bc4942a2ce4c46c7ef5d35;hp=889d051b905e490dc9006f993a24fc476871d5c5;hpb=49323eea600fb989d4181ccfd437ee12722ae733;p=libs%2Fgl.git 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();