]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture.cpp
Use UNSIGNED_SHORT for allocating DEPTH_COMPONENT textures
[libs/gl.git] / source / texture.cpp
index 6484440e08708075081bab3d9b54c20e2c4e55ec..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)