X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=b528ca30f5b6ccaee0ac81c0e78e86226f345a1a;hb=e01371d38e290b4c526146fd5d1388bba8201233;hp=004d78c2abc38d1b9bc383b361cefae647b8ac06;hpb=ccbfdfa0d9d796244b1ecc0fa3faa2c50304811b;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index 004d78c2..b528ca30 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -78,7 +78,7 @@ Texture::~Texture() DataType Texture::get_alloc_type(PixelFormat fmt) { - return (fmt==DEPTH_COMPONENT ? UNSIGNED_SHORT : UNSIGNED_BYTE); + return (get_base_pixelformat(fmt)==DEPTH_COMPONENT ? UNSIGNED_SHORT : UNSIGNED_BYTE); } void Texture::update_parameter(int mask) const @@ -364,5 +364,12 @@ void Texture::Loader::wrap_t(TextureWrap w) obj.set_wrap_t(w); } + +bool is_mipmapped(TextureFilter filter) +{ + return (filter==NEAREST_MIPMAP_NEAREST || filter==NEAREST_MIPMAP_LINEAR || + filter==LINEAR_MIPMAP_NEAREST || filter==LINEAR_MIPMAP_LINEAR); +} + } // namespace GL } // namespace Msp