+ if(auto_gen_mipmap && level==0)
+ {
+ generate_mipmap();
+ allocated |= (1<<get_n_levels())-1;
+ }
+}
+
+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");
+
+ Conditional<BindRestore> _bind(!ARB_direct_state_access, this);
+ allocate(level);
+
+ fmt = get_upload_format(fmt);
+ if(ARB_direct_state_access)
+ glTextureSubImage1D(id, level, x, wd, fmt, type, data);
+ else
+ glTexSubImage1D(target, level, x, wd, fmt, type, data);
+
+ if(auto_gen_mipmap && level==0)
+ generate_mipmap();
+}
+
+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)