- PixelFormat base_fmt = get_base_pixelformat(ifmt);
- DataType type = get_alloc_type(base_fmt);
- for(unsigned i=0; i<6; ++i)
- image(enumerate_faces(i), level, base_fmt, type, 0);
+ if(ARB_texture_storage)
+ {
+ BindRestore _bind(this);
+ glTexStorage2D(target, levels, ifmt, size, size);
+ allocated |= (1<<levels)-1;
+ }
+ else
+ {
+ PixelFormat base_fmt = get_base_pixelformat(ifmt);
+ DataType type = get_alloc_type(base_fmt);
+ for(unsigned i=0; i<6; ++i)
+ image(enumerate_faces(i), level, base_fmt, type, 0);
+ }