X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture2dmultisample_backend.cpp;h=e6ee7614b028b88c1c56ea1e11a78e3ead733598;hb=f73e671dcb36c097647cddbf5b1eaaad2ffc9299;hp=c4a4e42380d227666790386c6b9e1697617a80f2;hpb=160e9eea29bd10034733d59507fa1bcca36be401;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture2dmultisample_backend.cpp b/source/backends/opengl/texture2dmultisample_backend.cpp index c4a4e423..e6ee7614 100644 --- a/source/backends/opengl/texture2dmultisample_backend.cpp +++ b/source/backends/opengl/texture2dmultisample_backend.cpp @@ -19,6 +19,9 @@ void OpenGLTexture2DMultisample::allocate() unsigned height = static_cast(this)->height; unsigned samples = static_cast(this)->samples; + if(!id) + create(); + GLenum gl_fmt = get_gl_pixelformat(storage_fmt); if(ARB_texture_storage_multisample) { @@ -38,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