]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture3d.cpp
Implement automatic unloading when a total size limit is exceeded
[libs/gl.git] / source / texture3d.cpp
index 3846ef1c1294e18d78b183e4208366648c76a46f..61c745bb95bf4d8ae3df56c1c94c7aec43a686f7 100644 (file)
@@ -13,6 +13,7 @@ namespace GL {
 
 Texture3D::Texture3D():
        Texture(GL_TEXTURE_3D),
+       ifmt(RGB),
        width(0),
        height(0),
        depth(0),
@@ -135,5 +136,10 @@ void Texture3D::get_level_size(unsigned level, unsigned &w, unsigned &h, unsigne
                d = 1;
 }
 
+UInt64 Texture3D::get_data_size() const
+{
+       return id ? width*height*depth*get_pixel_size(ifmt) : 0;
+}
+
 } // namespace GL
 } // namespace Msp