X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=e237e504176ace2bfd56ddf74597907aee397abb;hp=2da1c25245b1064cf8da073c8e9c4d919fb9417a;hb=4d7f66ea28c788e12f700216b9c53af9e71b8390;hpb=8ed7051d1a80c7e8b198d96575338eee6a5e2485 diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 2da1c252..e237e504 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -32,6 +32,7 @@ public: Texture2D::Texture2D(ResourceManager *m): Texture(GL_TEXTURE_2D, m), + ifmt(RGB), width(0), height(0), allocated(0) @@ -139,6 +140,11 @@ Resource::AsyncLoader *Texture2D::load(IO::Seekable &io) return new AsyncLoader(*this, io); } +UInt64 Texture2D::get_data_size() const +{ + return id ? width*height*get_component_count(ifmt) : 0; +} + void Texture2D::unload() { glDeleteTextures(1, &id);