]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.cpp
Add uniform integer vectors of 2, 3 and 4 elements
[libs/gl.git] / source / texture.cpp
index 22bdebdfd2a02eca284a0183c29a2f942b7a1631..8d43143c9d734c218211d070890bf4cd080b42ed 100644 (file)
@@ -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);
 }