X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;h=1c6c4962e46a1a3eb4b0c8817beed3dcfb726b9f;hb=bb386d895f5fce2f0099886fdf7e7073b18246e8;hp=d006e383cc998af09fa478b18bb8bc4ce047ecfc;hpb=efb45a6851563cdb8077b6aad3ab92d4006d8790;p=libs%2Fgl.git diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index d006e383..1c6c4962 100644 --- a/source/core/texturecube.cpp +++ b/source/core/texturecube.cpp @@ -54,7 +54,11 @@ TextureCube::TextureCube(): void TextureCube::storage(PixelFormat fmt, unsigned sz, unsigned lv) { if(size>0) - throw invalid_operation("TextureCube::storage"); + { + if(fmt!=format || sz!=size || (lv && lv!=levels)) + throw incompatible_data("TextureCube::storage"); + return; + } if(sz==0) throw invalid_argument("TextureCube::storage"); @@ -79,7 +83,7 @@ void TextureCube::allocate(unsigned level) BindRestore _bind(this); glTexStorage2D(target, levels, storage_fmt, size, size); apply_swizzle(); - allocated |= (1<