return sub_image(face, level, 0, 0, lsz, lsz, data);
}
-void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y, unsigned wd, unsigned ht, const void *data)
+void TextureCube::sub_image(TextureCubeFace face, unsigned level, unsigned x, unsigned y, unsigned wd, unsigned ht, const void *data)
{
if(size==0)
throw invalid_operation("TextureCube::sub_image");
- if(level>=levels)
+ if(level>=levels || x>size || x+wd>size || y>size || y+ht>size)
throw out_of_range("TextureCube::sub_image");
TextureCubeBackend::sub_image(face, level, x, y, wd, ht, data);