X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture1d_backend.cpp;h=b8424872b37c3ee960801bfda52eddd4f4185611;hb=66b944b448c3e500d5c641bfad6e18b126f3372a;hp=a94a5c44ac9d99610d38003b632b2a1d7dfe9dd1;hpb=4965ad140daacd10e77b74ce9b49e98c4c4dae55;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture1d_backend.cpp b/source/backends/opengl/texture1d_backend.cpp index a94a5c44..b8424872 100644 --- a/source/backends/opengl/texture1d_backend.cpp +++ b/source/backends/opengl/texture1d_backend.cpp @@ -62,5 +62,20 @@ void OpenGLTexture1D::sub_image(unsigned level, int x, unsigned wd, const void * } } +size_t OpenGLTexture1D::get_data_size() const +{ + if(!id) + return 0; + + unsigned width = static_cast(this)->width; + unsigned levels = static_cast(this)->levels; + + size_t level_size = width*get_pixel_size(storage_fmt); + size_t total_size = level_size; + for(unsigned i=0; i>=2) + total_size += level_size; + return total_size; +} + } // namespace GL } // namespace Msp