X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture1d.cpp;h=7163aa7a78d846ed834c32abcdb67fcc99201aa8;hb=fb5ca4dbba257d3eb7fa15800d9663b774e41e7e;hp=a1ee418b22381a27916c407a6d8050459c02ddb0;hpb=03d3984ecd2c4e7c38b6a62b4b7a81bab69f8d40;p=libs%2Fgl.git diff --git a/source/texture1d.cpp b/source/texture1d.cpp index a1ee418b..7163aa7a 100644 --- a/source/texture1d.cpp +++ b/source/texture1d.cpp @@ -71,13 +71,16 @@ void Texture1D::image(unsigned level, PixelFormat fmt, DataType type, const void return sub_image(level, 0, w, fmt, type, data); BindRestore _bind(this); + + if(!allocated) + glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, levels-1); glTexImage1D(target, level, ifmt, w, 0, get_upload_format(fmt), type, data); allocated |= 1<