unsigned d = depth;
get_level_size(level, w, h, d);
- BindRestore _bind(this);
if(ARB_texture_storage)
- sub_image(level, 0, 0, 0, w, h, d, fmt, type, data);
- else
- glTexImage3D(target, level, ifmt, width, height, depth, 0, fmt, type, data);
+ return sub_image(level, 0, 0, 0, w, h, d, fmt, type, data);
+
+ BindRestore _bind(this);
+ glTexImage3D(target, level, ifmt, width, height, depth, 0, fmt, type, data);
allocated |= 1<<level;
if(gen_mipmap && level==0)
if(width==0 || height==0 || depth==0)
throw invalid_operation("Texture3D::image");
+ BindRestore _bind(this);
allocate(level);
- BindRestore _bind(this);
glTexSubImage3D(target, level, x, y, z, wd, ht, dp, fmt, type, data);
+
+ if(gen_mipmap && level==0)
+ auto_generate_mipmap();
}
void Texture3D::load_image(const string &fn, int dp)