X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexturecube_backend.cpp;h=2b9e09a9c90ecb9a0f27ce48b37e1b9ae747de97;hb=f73e671dcb36c097647cddbf5b1eaaad2ffc9299;hp=cc8945896fea9bdaad6763e4eedda5af50df859c;hpb=57ca8f2bd18525d80ed6ad5d3f72e57901162d55;p=libs%2Fgl.git diff --git a/source/backends/opengl/texturecube_backend.cpp b/source/backends/opengl/texturecube_backend.cpp index cc894589..2b9e09a9 100644 --- a/source/backends/opengl/texturecube_backend.cpp +++ b/source/backends/opengl/texturecube_backend.cpp @@ -32,7 +32,7 @@ void OpenGLTextureCube::allocate() unsigned levels = static_cast(this)->levels; if(!id) - generate_id(); + create(); GLenum gl_fmt = get_gl_pixelformat(storage_fmt); if(ARB_texture_storage) @@ -75,6 +75,13 @@ void OpenGLTextureCube::sub_image(unsigned face, unsigned level, int x, int y, u } } +size_t OpenGLTextureCube::get_data_size() const +{ + unsigned size = static_cast(this)->size; + return id ? size*size*6*get_pixel_size(storage_fmt) : 0; +} + + unsigned get_gl_cube_face(unsigned face) { switch(static_cast(face))