X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;h=1c6c4962e46a1a3eb4b0c8817beed3dcfb726b9f;hb=18449fc11c620be7b3115f28a5edfb57eb5985ef;hp=6ec3662523dea02903e024bb9113b91125e4b711;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 6ec36625..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<