if(ARB_texture_storage)
{
if(ARB_direct_state_access)
- glTextureStorage2D(id, self.levels, gl_fmt, self.size, self.size);
+ glTextureStorage2D(id, n_levels, gl_fmt, self.size, self.size);
else
{
bind_scratch();
- glTexStorage2D(target, self.levels, gl_fmt, self.size, self.size);
+ glTexStorage2D(target, n_levels, gl_fmt, self.size, self.size);
}
}
else
bind_scratch();
GLenum comp = get_gl_components(get_components(storage_fmt));
GLenum type = get_gl_type(get_component_type(storage_fmt));
- for(unsigned i=0; i<self.levels; ++i)
+ for(unsigned i=0; i<n_levels; ++i)
{
unsigned lv_size = static_cast<const TextureCube *>(this)->get_level_size(i);
for(unsigned j=0; j<6; ++j)
glTexImage2D(get_gl_cube_face(j), i, gl_fmt, lv_size, lv_size, 0, comp, type, 0);
}
- glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, self.levels-1);
+ glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, n_levels-1);
}
apply_swizzle();
size_t level_size = self.size*self.size*get_pixel_size(storage_fmt);
size_t total_size = level_size;
- for(unsigned i=0; i<self.levels; ++i, level_size>>=2)
+ for(unsigned i=0; i<n_levels; ++i, level_size>>=2)
total_size += level_size;
return total_size;
}