X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;h=c56094c9cb0bd36e837db1df0c1c115fc38ad876;hp=4984985c807489b28d6f5737c2f2ba03286488d3;hb=3a1b9cbe2441ae670a97541dc8ccb0a2860c8302;hpb=9b3bce7ae76ff8c0c81315d2505ea96bf422a318 diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 4984985c..c56094c9 100644 --- a/source/core/texturecube.cpp +++ b/source/core/texturecube.cpp @@ -5,9 +5,7 @@ #include #include #include -#include "bindable.h" #include "error.h" -#include "pixelstore.h" #include "texturecube.h" using namespace std; @@ -82,34 +80,23 @@ 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<(img.get_pixels()); unsigned face_size = img.get_stride()*size; for(unsigned i=0; i<6; ++i) @@ -316,7 +270,7 @@ Vector3 TextureCube::get_texel_direction(TextureCubeFace face, unsigned u, unsig return fv+s*sv+t*tv; } -UInt64 TextureCube::get_data_size() const +uint64_t TextureCube::get_data_size() const { return id ? size*size*6*get_pixel_size(storage_fmt) : 0; }