]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texturecube.cpp
Include only tangent in mesh data and calculate binormal on the fly
[libs/gl.git] / source / core / texturecube.cpp
index 6ec3662523dea02903e024bb9113b91125e4b711..3e0b9fc14d2b430cd16040f743294b0aae502419 100644 (file)
@@ -79,7 +79,7 @@ void TextureCube::allocate(unsigned level)
                BindRestore _bind(this);
                glTexStorage2D(target, levels, storage_fmt, size, size);
                apply_swizzle();
-               allocated |= (1<<levels)-1;
+               allocated |= (64<<levels)-1;
        }
        else
        {
@@ -109,7 +109,7 @@ void TextureCube::image(TextureCubeFace face, unsigned level, const void *data)
        }
 
        PixelComponents comp = get_components(storage_fmt);
-       DataType type = get_component_type(storage_fmt);
+       GLenum type = get_gl_type(get_component_type(storage_fmt));
        glTexImage2D(face, level, storage_fmt, s, s, 0, comp, type, data);
 
        if(level==0)
@@ -151,7 +151,7 @@ void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y,
        allocate(level);
 
        PixelComponents comp = get_components(storage_fmt);
-       DataType type = get_component_type(storage_fmt);
+       GLenum type = get_gl_type(get_component_type(storage_fmt));
        glTexSubImage2D(face, level, x, y, wd, ht, comp, type, data);
 
        if(auto_gen_mipmap && level==0)