X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture3d.cpp;h=c8f59a094a0fed550a37a5721ae26329941a54ae;hb=fb5ca4dbba257d3eb7fa15800d9663b774e41e7e;hp=ed5619cb4aed30f567cf7e3e063a7ad05f60fd27;hpb=40e1eba6c489e11a4c9b8865ddcd3ec3d9f83818;p=libs%2Fgl.git diff --git a/source/texture3d.cpp b/source/texture3d.cpp index ed5619cb..c8f59a09 100644 --- a/source/texture3d.cpp +++ b/source/texture3d.cpp @@ -90,13 +90,16 @@ void Texture3D::image(unsigned level, PixelFormat fmt, DataType type, const void return sub_image(level, 0, 0, 0, w, h, d, fmt, type, data); BindRestore _bind(this); + + if(!allocated) + glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, levels-1); glTexImage3D(target, level, ifmt, width, height, depth, 0, get_upload_format(fmt), type, data); allocated |= 1<