X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;fp=source%2Fcore%2Ftexturecube.cpp;h=5ee772cab94d742b7939c5373cb36614bca8b4e1;hb=ada4b7614137221b64a00f31fde1498064e9fb19;hp=4bbf7e6f5d07da4e1f322775124e1b3eefe9de79;hpb=6065f6622cc275dc0b20baaf7c267e71169d18f3;p=libs%2Fgl.git diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 4bbf7e6f..5ee772ca 100644 --- a/source/core/texturecube.cpp +++ b/source/core/texturecube.cpp @@ -45,8 +45,7 @@ unsigned TextureCube::orientations[12] = TextureCube::TextureCube(): Texture(GL_TEXTURE_CUBE_MAP), - size(0), - allocated(0) + size(0) { static Require _req(ARB_texture_cube_map); if(ARB_seamless_cube_map) @@ -69,74 +68,39 @@ void TextureCube::storage(PixelFormat fmt, unsigned sz, unsigned lv) levels = get_n_levels(); if(lv>0) levels = min(levels, lv); -} - -void TextureCube::allocate(unsigned level) -{ - if(size==0) - throw invalid_operation("TextureCube::allocate"); - if(level>=levels) - throw invalid_argument("TextureCube::allocate"); - if(allocated&(64<=levels) - throw out_of_range("TextureCube::image"); - unsigned lsz = get_level_size(level); - - if(ARB_texture_storage) - return sub_image(face, level, 0, 0, lsz, lsz, data); - - if(!allocated) - { - glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, levels-1); - apply_swizzle(); - } - - 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)); - glTexImage2D(face, level, fmt, lsz, lsz, 0, comp, type, data); - - if(level==0) - { - allocated |= 1<=levels) throw out_of_range("TextureCube::sub_image"); - allocate(level); - GLenum comp = get_gl_components(get_components(storage_fmt)); GLenum type = get_gl_type(get_component_type(storage_fmt)); if(ARB_direct_state_access)