X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;h=c56094c9cb0bd36e837db1df0c1c115fc38ad876;hp=2db1b63b92162c358618c7c3d7a6a0831ce3cb5e;hb=3a1b9cbe2441ae670a97541dc8ccb0a2860c8302;hpb=a0538cdd026622f7f0f3e2ac1f9c2bd54c4a6014 diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 2db1b63b..c56094c9 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<