X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture3d.cpp;fp=source%2Fcore%2Ftexture3d.cpp;h=705a40ba5574cc950078d119e9061a90e6bd9272;hb=7b569bbfcfb65d8d88b47ac42ee1df6a7d27e784;hp=bdb87882e878333c23e88373bc85b57d277c7e74;hpb=bea2bcf1aa353b1dd8d1728931ef0508677bd2c6;p=libs%2Fgl.git diff --git a/source/core/texture3d.cpp b/source/core/texture3d.cpp index bdb87882..705a40ba 100644 --- a/source/core/texture3d.cpp +++ b/source/core/texture3d.cpp @@ -57,22 +57,6 @@ void Texture3D::allocate(unsigned level) throw invalid_operation("Texture3D::allocate"); if(level>=levels) throw invalid_argument("Texture3D::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 Texture3D::allocate_(unsigned level) -{ if(allocated&(1<=levels) throw out_of_range("Texture3D::image"); + LinAl::Vector size = get_level_size(level); + if(ARB_texture_storage) - { - LinAl::Vector size = get_level_size(level); return sub_image(level, 0, 0, 0, size.x, size.y, size.z, data); - } - - glActiveTexture(GL_TEXTURE0); - glBindTexture(target, id); - - image_(level, data); - - if(auto_gen_mipmap && level==0) - { - generate_mipmap_(); - allocated |= (1< size = get_level_size(level); GLenum fmt = get_gl_pixelformat(storage_fmt); GLenum comp = get_gl_components(get_components(storage_fmt)); GLenum type = get_gl_type(get_component_type(storage_fmt)); glTexImage3D(target, level, fmt, size.x, size.y, size.z, 0, comp, type, data); allocated |= 1<=levels) throw out_of_range("Texture3D::sub_image"); - bool direct = (ARB_direct_state_access && (ARB_texture_storage || (allocated&(1<