]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture1d.cpp
Implement sub_image for Texture1D
[libs/gl.git] / source / texture1d.cpp
index 043e0c0e1008bcc4346cc6852b42ad19d9f99e4a..a0ab79b943aef573e192edcc36e1e011fffb77c7 100644 (file)
@@ -57,6 +57,17 @@ void Texture1D::image(unsigned level, PixelFormat fmt, DataType type, const void
        }
 }
 
+void Texture1D::sub_image(unsigned level, int x, unsigned wd, PixelFormat fmt, DataType type, const void *data)
+{
+       if(width==0)
+               throw invalid_operation("Texture3D::image");
+
+       allocate(level);
+
+       BindRestore _bind(this);
+       glTexSubImage1D(target, level, x, wd, fmt, type, data);
+}
+
 void Texture1D::image(const Graphics::Image &img, bool srgb)
 {
        if(img.get_height()!=1)