X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture.cpp;h=0d7a81512e7f73f5c0a49659b4feddc16739c582;hb=97818e67b2543a6075c13e6bf22c296757b975e5;hp=b8a2614a1da9b697410067a7daaad807476ace7c;hpb=8e58fc4da8443cb67fe4cd70d6f68de2be73011d;p=libs%2Fgl.git diff --git a/source/core/texture.cpp b/source/core/texture.cpp index b8a2614a..0d7a8151 100644 --- a/source/core/texture.cpp +++ b/source/core/texture.cpp @@ -15,12 +15,7 @@ namespace Msp { 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) @@ -39,6 +34,13 @@ 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;