X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=8d43143c9d734c218211d070890bf4cd080b42ed;hb=9885c5465db78b6a1d9cc8bf7ffa7a79fb116afc;hp=22bdebdfd2a02eca284a0183c29a2f942b7a1631;hpb=7d7a8f9e77a526fd5f2920b9005805e56a4b686c;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index 22bdebdf..8d43143c 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -75,6 +75,11 @@ Texture::~Texture() glDeleteTextures(1, &id); } +DataType Texture::get_alloc_type(PixelFormat fmt) +{ + return (fmt==DEPTH_COMPONENT ? UNSIGNED_SHORT : UNSIGNED_BYTE); +} + void Texture::update_parameter(int mask) const { if(TexUnit::current().get_texture()!=this) @@ -185,7 +190,8 @@ void Texture::auto_generate_mipmap() void Texture::set_compare_enabled(bool c) { - static Require _req(ARB_shadow); + if(c) + static Require _req(ARB_shadow); compare = c; update_parameter(COMPARE); }