X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;h=01820fa8766be6afa5235419c5da9d63062a6388;hb=2d3113a7dbbe4be2f1d1e8980c1c4e42175163da;hp=6ec3662523dea02903e024bb9113b91125e4b711;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 6ec36625..01820fa8 100644 --- a/source/core/texturecube.cpp +++ b/source/core/texturecube.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -49,12 +50,18 @@ TextureCube::TextureCube(): allocated(0) { static Require _req(ARB_texture_cube_map); + if(ARB_seamless_cube_map) + glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); } 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 +86,7 @@ void TextureCube::allocate(unsigned level) BindRestore _bind(this); glTexStorage2D(target, levels, storage_fmt, size, size); apply_swizzle(); - allocated |= (1<