X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexturecube.cpp;fp=source%2Ftexturecube.cpp;h=e767423fe539f9ee92fd10dd5af8f1beaa6eebb4;hb=194f960f91041ebee44e2745627d5e480e893d82;hp=a9961af90a3900660f2e2c71a5a46be8820f6441;hpb=6f8c0c6c088be92804cb413c0234bfb817ef2d8d;p=libs%2Fgl.git diff --git a/source/texturecube.cpp b/source/texturecube.cpp index a9961af9..e767423f 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -77,10 +77,10 @@ void TextureCube::image(TextureCubeFace face, unsigned level, PixelFormat fmt, D if(s==0) throw out_of_range("TextureCube::image"); - BindRestore _bind(this); if(ARB_texture_storage) return sub_image(face, level, 0, 0, s, s, fmt, type, data); + BindRestore _bind(this); glTexImage2D(face, level, ifmt, s, s, 0, fmt, type, data); // XXX Allocation should be tracked per-face, but we'll run out of bits @@ -98,9 +98,9 @@ void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y, if(size==0) throw invalid_operation("TextureCube::sub_image"); + BindRestore _bind(this); allocate(level); - BindRestore _bind(this); glTexSubImage2D(face, level, x, y, wd, ht, fmt, type, data); if(gen_mipmap && level==0)