X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=95f9f790507292797573931f9c241b6ae877be6e;hp=4d3dac037291137856d28a77926e9517ac9475de;hb=e01371d38e290b4c526146fd5d1388bba8201233;hpb=4a577ddc946bd279d7bc4942a2ce4c46c7ef5d35 diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 4d3dac03..95f9f790 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -85,8 +85,7 @@ void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void if(gen_mipmap && level==0) { auto_generate_mipmap(); - for(; (w || h); w>>=1, h>>=1, ++level) ; - allocated |= (1<>=1, ++n) ; + return n; +} + +void Texture2D::get_level_size(unsigned level, unsigned &w, unsigned &h) const { w >>= level; h >>= level;