X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexturecube.cpp;h=0613a39a8ebba335a56f42a9ec958c9a796ac45e;hb=fb5ca4dbba257d3eb7fa15800d9663b774e41e7e;hp=19c3bf074b9a3557adf7668c4752f22bda3bcb8c;hpb=cdf928f03f4d8383b8fa978abc4c255a850ec061;p=libs%2Fgl.git diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 19c3bf07..0613a39a 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -51,7 +51,7 @@ TextureCube::TextureCube(): static Require _req(ARB_texture_cube_map); } -void TextureCube::storage(PixelFormat fmt, unsigned sz) +void TextureCube::storage(PixelFormat fmt, unsigned sz, unsigned lv) { if(size>0) throw invalid_operation("TextureCube::storage"); @@ -60,19 +60,25 @@ void TextureCube::storage(PixelFormat fmt, unsigned sz) set_internal_format(fmt); size = sz; + levels = get_n_levels(); + if(lv>0) + levels = min(levels, lv); } void TextureCube::allocate(unsigned level) { - if(allocated&(1<=levels) + throw invalid_argument("TextureCube::allocate"); + if(allocated&(64<>(const LexicalConverter &conv, TextureCubeFace &face) {