X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture2darray_backend.cpp;h=edca615d91a8440ca7cabfa3fca8b7db235a9a0e;hb=e2a707feb62c5df69884cca34d099dd2f7b7e4e2;hp=610229ba4acf96f16cb7d4cf92761ab21c5c128f;hpb=2b930a353df652ade5baacae21d5d8a01f37c09d;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture2darray_backend.cpp b/source/backends/opengl/texture2darray_backend.cpp index 610229ba..edca615d 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