]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture1d.cpp
Implement automatic unloading when a total size limit is exceeded
[libs/gl.git] / source / texture1d.cpp
index bcebca49565131eb738ba471af992cbe0e05c1a9..f700d013b5dc6a55f88196695b8a8ec83b2242b9 100644 (file)
@@ -9,6 +9,7 @@ namespace GL {
 
 Texture1D::Texture1D():
        Texture(GL_TEXTURE_1D),
+       ifmt(RGB),
        width(0),
        allocated(0)
 { }
@@ -56,5 +57,10 @@ unsigned Texture1D::get_level_size(unsigned level)
        return width>>level;
 }
 
+UInt64 Texture1D::get_data_size() const
+{
+       return id ? width*get_pixel_size(ifmt) : 0;
+}
+
 } // namespace GL
 } // namespace Msp