X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;fp=source%2Fcore%2Ftexturecube.cpp;h=a2c6c8eb62725c21ce21553cf30926b01fe127e8;hb=7b569bbfcfb65d8d88b47ac42ee1df6a7d27e784;hp=2db1b63b92162c358618c7c3d7a6a0831ce3cb5e;hpb=bea2bcf1aa353b1dd8d1728931ef0508677bd2c6;p=libs%2Fgl.git diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 2db1b63b..a2c6c8eb 100644 --- a/source/core/texturecube.cpp +++ b/source/core/texturecube.cpp @@ -77,22 +77,6 @@ void TextureCube::allocate(unsigned level) throw invalid_operation("TextureCube::allocate"); if(level>=levels) throw invalid_argument("TextureCube::allocate"); - - bool direct = ARB_texture_storage && ARB_direct_state_access; - if(!direct) - { - glActiveTexture(GL_TEXTURE0); - glBindTexture(target, id); - } - - allocate_(level); - - if(!direct) - glBindTexture(target, 0); -} - -void TextureCube::allocate_(unsigned level) -{ if(allocated&(64<=levels) throw out_of_range("TextureCube::image"); + unsigned lsz = get_level_size(level); + if(ARB_texture_storage) - { - unsigned lsz = get_level_size(level); return sub_image(face, level, 0, 0, lsz, lsz, data); - } - - glActiveTexture(GL_TEXTURE0); - glBindTexture(target, id); - - image_(face, level, data); - if(auto_gen_mipmap && level==0 && (allocated&63)==63) - { - generate_mipmap_(); - allocated |= (64<=levels) throw out_of_range("TextureCube::sub_image"); - bool direct = (ARB_direct_state_access && (ARB_texture_storage || (allocated&(1<