X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=23cb9477e122c69ddabdbf614dfafca05ed71801;hb=194f960f91041ebee44e2745627d5e480e893d82;hp=4aad82d27ad9eeb71678e1b9b1d23386751c6ece;hpb=cb836adcf11f690188df9b7bc59f3fe87b67aaa7;p=libs%2Fgl.git diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 4aad82d2..23cb9477 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -89,11 +89,11 @@ void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void unsigned h = height; get_level_size(level, w, h); - BindRestore _bind(this); if(ARB_texture_storage) - sub_image(level, 0, 0, w, h, fmt, type, data); - else - glTexImage2D(target, level, ifmt, w, h, 0, fmt, type, data); + return sub_image(level, 0, 0, w, h, fmt, type, data); + + BindRestore _bind(this); + glTexImage2D(target, level, ifmt, w, h, 0, fmt, type, data); allocated |= 1<