]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/texture1d_backend.cpp
Move the Resource function override of Texture classes into backend
[libs/gl.git] / source / backends / opengl / texture1d_backend.cpp
index bd754fde1091eb42b67fe6787ed2713b421d0f09..a270468b141883437f46d51de02a54888f69ee6f 100644 (file)
@@ -20,7 +20,7 @@ void OpenGLTexture1D::allocate()
        unsigned levels = static_cast<const Texture1D *>(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<const Texture1D *>(this)->width;
+       return id ? width*get_pixel_size(storage_fmt) : 0;
+}
+
 } // namespace GL
 } // namespace Msp