X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture1d.cpp;h=7c3f02ab5f97988af099937eb6ed52254542b332;hb=6065f6622cc275dc0b20baaf7c267e71169d18f3;hp=7685d39e99abaeca025ae1c4750b6a53903ff08a;hpb=9b3bce7ae76ff8c0c81315d2505ea96bf422a318;p=libs%2Fgl.git diff --git a/source/core/texture1d.cpp b/source/core/texture1d.cpp index 7685d39e..7c3f02ab 100644 --- a/source/core/texture1d.cpp +++ b/source/core/texture1d.cpp @@ -1,8 +1,6 @@ -#include #include #include #include -#include "bindable.h" #include "error.h" #include "texture1d.h" @@ -43,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; }