X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture1d.cpp;h=7c3f02ab5f97988af099937eb6ed52254542b332;hb=6065f6622cc275dc0b20baaf7c267e71169d18f3;hp=4c58d4701639d777b0471b846acc7717d480c90b;hpb=715672cf2c64dab0744db676fdee255ee3a4cef7;p=libs%2Fgl.git diff --git a/source/core/texture1d.cpp b/source/core/texture1d.cpp index 4c58d470..7c3f02ab 100644 --- a/source/core/texture1d.cpp +++ b/source/core/texture1d.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -42,36 +41,24 @@ void Texture1D::allocate(unsigned level) throw invalid_operation("Texture1D::allocate"); if(level>=levels) throw invalid_argument("Texture1D::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 Texture1D::allocate_(unsigned level) -{ if(allocated&(1<=levels) throw out_of_range("Texture1D::sub_image"); - bool direct = (ARB_direct_state_access && (ARB_texture_storage || (allocated&(1<>level; } -UInt64 Texture1D::get_data_size() const +uint64_t Texture1D::get_data_size() const { return id ? width*get_pixel_size(storage_fmt) : 0; }