X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture1d_backend.cpp;h=a270468b141883437f46d51de02a54888f69ee6f;hb=f73e671dcb36c097647cddbf5b1eaaad2ffc9299;hp=bd754fde1091eb42b67fe6787ed2713b421d0f09;hpb=57ca8f2bd18525d80ed6ad5d3f72e57901162d55;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture1d_backend.cpp b/source/backends/opengl/texture1d_backend.cpp index bd754fde..a270468b 100644 --- a/source/backends/opengl/texture1d_backend.cpp +++ b/source/backends/opengl/texture1d_backend.cpp @@ -20,7 +20,7 @@ void OpenGLTexture1D::allocate() unsigned levels = static_cast(this)->levels; if(!id) - generate_id(); + create(); GLenum gl_fmt = get_gl_pixelformat(storage_fmt); if(ARB_texture_storage) @@ -62,5 +62,11 @@ void OpenGLTexture1D::sub_image(unsigned level, int x, unsigned wd, const void * } } +size_t OpenGLTexture1D::get_data_size() const +{ + unsigned width = static_cast(this)->width; + return id ? width*get_pixel_size(storage_fmt) : 0; +} + } // namespace GL } // namespace Msp