X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture2darray_backend.cpp;h=5e04dc0da482d754e57adb9d4607b7afb9445045;hp=610229ba4acf96f16cb7d4cf92761ab21c5c128f;hb=HEAD;hpb=160e9eea29bd10034733d59507fa1bcca36be401 diff --git a/source/backends/opengl/texture2darray_backend.cpp b/source/backends/opengl/texture2darray_backend.cpp index 610229ba..5e04dc0d 100644 --- a/source/backends/opengl/texture2darray_backend.cpp +++ b/source/backends/opengl/texture2darray_backend.cpp @@ -10,5 +10,17 @@ OpenGLTexture2DArray::OpenGLTexture2DArray(): static Require _req(EXT_texture_array); } +size_t OpenGLTexture2DArray::get_data_size() const +{ + if(!id) + return 0; + + size_t level_size = width*height*get_pixel_size(format); + size_t total_size = level_size; + for(unsigned i=0; i>=2) + total_size += level_size*depth; + return total_size; +} + } // namespace GL } // namespace Msp