X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture2dmultisample_backend.cpp;h=e6ee7614b028b88c1c56ea1e11a78e3ead733598;hb=f73e671dcb36c097647cddbf5b1eaaad2ffc9299;hp=71f9e138abddee50a7c157c0ef7e33b0dfda7a3a;hpb=57ca8f2bd18525d80ed6ad5d3f72e57901162d55;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture2dmultisample_backend.cpp b/source/backends/opengl/texture2dmultisample_backend.cpp index 71f9e138..e6ee7614 100644 --- a/source/backends/opengl/texture2dmultisample_backend.cpp +++ b/source/backends/opengl/texture2dmultisample_backend.cpp @@ -20,7 +20,7 @@ void OpenGLTexture2DMultisample::allocate() unsigned samples = static_cast(this)->samples; if(!id) - generate_id(); + create(); GLenum gl_fmt = get_gl_pixelformat(storage_fmt); if(ARB_texture_storage_multisample) @@ -41,5 +41,13 @@ void OpenGLTexture2DMultisample::allocate() apply_swizzle(); } +size_t OpenGLTexture2DMultisample::get_data_size() const +{ + unsigned width = static_cast(this)->width; + unsigned height = static_cast(this)->height; + unsigned samples = static_cast(this)->samples; + return width*height*get_pixel_size(format)*samples; +} + } // namespace GL } // namespace Msp