namespace GL {
Texture::Texture(unsigned t):
- TextureBackend(t),
- format(NO_PIXELFORMAT),
- storage_fmt(format),
- swizzle(NO_SWIZZLE),
- use_srgb_format(false),
- auto_gen_mipmap(false)
+ TextureBackend(t)
{ }
void Texture::set_format(PixelFormat fmt)
swizzle = swiz;
}
+unsigned Texture::count_levels(unsigned size)
+{
+ unsigned n = 0;
+ for(; size; size>>=1, ++n) ;
+ return n;
+}
+
void Texture::load_image(const string &fn, unsigned lv)
{
Graphics::Image img;