X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=7586862591675534a50bf13b076021701ec004b0;hb=aead6d04308d7873dc99aa4572ce1590a89ebcbd;hp=08383526728bb7a239b8551c910c75c6a2ff2f03;hpb=a9bf08d7c8d54204b76f91dab95052b737595bea;p=libs%2Fgl.git diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 08383526..75868625 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -101,13 +101,16 @@ void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void return sub_image(level, 0, 0, w, h, fmt, type, data); BindRestore _bind(this); + + if(!allocated) + glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, levels-1); glTexImage2D(target, level, ifmt, w, h, 0, get_upload_format(fmt), type, data); allocated |= 1<