X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture1d.cpp;h=d09a9570306e077b771d31dce598757e2fc715fb;hp=d88b88c02e57c763d7c3b7731cbb4a159eb430d4;hb=aead6d04308d7873dc99aa4572ce1590a89ebcbd;hpb=344dd6a52b55d847f3346e94ec266a8864764b9d diff --git a/source/texture1d.cpp b/source/texture1d.cpp index d88b88c0..d09a9570 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<