]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturecube.cpp
Implement automatic unloading when a total size limit is exceeded
[libs/gl.git] / source / texturecube.cpp
index b071e8545df50ce665b1476b0683058a00af0590..7f5250ee99e1381195977b1a40e12b77a8220839 100644 (file)
@@ -23,6 +23,7 @@ Vector3 TextureCube::directions[6] =
 
 TextureCube::TextureCube():
        Texture(GL_TEXTURE_CUBE_MAP),
+       ifmt(RGB),
        size(0),
        allocated(0)
 {
@@ -166,6 +167,11 @@ Vector3 TextureCube::get_texel_direction(TextureCubeFace face, unsigned u, unsig
        return fv+s*sv+t*tv;
 }
 
+UInt64 TextureCube::get_data_size() const
+{
+       return id ? size*size*6*get_pixel_size(ifmt) : 0;
+}
+
 
 TextureCube::Loader::Loader(TextureCube &t):
        DataFile::DerivedObjectLoader<TextureCube, Texture::Loader>(t)