X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture1d.cpp;h=78c9ed0c54209a067c51516126b797289ddb82d4;hb=49323eea600fb989d4181ccfd437ee12722ae733;hp=043e0c0e1008bcc4346cc6852b42ad19d9f99e4a;hpb=d2efbd8a32efa2a3ee8542efc846277af19d63e0;p=libs%2Fgl.git diff --git a/source/texture1d.cpp b/source/texture1d.cpp index 043e0c0e..78c9ed0c 100644 --- a/source/texture1d.cpp +++ b/source/texture1d.cpp @@ -23,6 +23,9 @@ void Texture1D::storage(PixelFormat fmt, unsigned wd) throw invalid_operation("Texture1D::storage"); if(wd==0) throw invalid_argument("Texture1D::storage"); + + if(MSP_sized_internal_formats) + fmt = get_sized_pixelformat(fmt); require_pixelformat(fmt); ifmt = fmt; @@ -57,6 +60,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)