+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)
+ throw incompatible_data("Texture1D::image");
+
+ unsigned w = img.get_width();
+ PixelFormat fmt = pixelformat_from_graphics(img.get_format());
+ if(width==0)
+ storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w);
+ else if(w!=width)
+ throw incompatible_data("Texture1D::image");
+
+ image(0, fmt, UNSIGNED_BYTE, img.get_data());
+}
+