X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture2d.cpp;fp=source%2Ftexture2d.cpp;h=7586862591675534a50bf13b076021701ec004b0;hp=47e0c7434d0ef56c7fbf892b0ee45a31f4552710;hb=aead6d04308d7873dc99aa4572ce1590a89ebcbd;hpb=344dd6a52b55d847f3346e94ec266a8864764b9d diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 47e0c743..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<