X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture2d.cpp;h=9ebc3cc5fc496e0e7afe057f12f26c7796637b10;hb=33b6ca811172d402fc891eeed9cd2a5edc28d61d;hp=528c4a58d216416ad2ca9816852bd0a7001d2a9e;hpb=a92362ad19b65f66b98e0dc4d034da5e4eb5cf36;p=libs%2Fgl.git diff --git a/source/core/texture2d.cpp b/source/core/texture2d.cpp index 528c4a58..9ebc3cc5 100644 --- a/source/core/texture2d.cpp +++ b/source/core/texture2d.cpp @@ -2,7 +2,6 @@ #include #include #include -#include "bindable.h" #include "buffer.h" #include "error.h" #include "resources.h" @@ -92,10 +91,11 @@ void Texture2D::allocate_(unsigned level) if(ARB_texture_storage) { + GLenum fmt = get_gl_pixelformat(storage_fmt); if(ARB_direct_state_access) - glTextureStorage2D(id, levels, storage_fmt, width, height); + glTextureStorage2D(id, levels, fmt, width, height); else - glTexStorage2D(target, levels, storage_fmt, width, height); + glTexStorage2D(target, levels, fmt, width, height); apply_swizzle(); allocated |= (1< size = get_level_size(level); - PixelComponents comp = get_components(storage_fmt); + 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(target, level, storage_fmt, size.x, size.y, 0, comp, type, data); + glTexImage2D(target, level, fmt, size.x, size.y, 0, comp, type, data); allocated |= 1<