X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=1452cfbb44c3afe099a444cdb44d557015061051;hb=0a151ebd17ae98eb145713889887d5070c8a12fb;hp=a7e4898c1edae7d73de8efe9bf425dbb69ccc569;hpb=6dc3e14d26c747dfcece883771f457e5561c5d09;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index a7e4898c..1452cfbb 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -97,24 +97,24 @@ DataType Texture::get_alloc_type(PixelFormat fmt) void Texture::set_internal_format(PixelFormat fmt) { - if(!get_component_size(fmt) && OES_required_internalformat) - fmt = get_default_sized_pixelformat(fmt); - FormatSwizzle swiz = NO_SWIZZLE; if(ARB_texture_rg && ARB_texture_swizzle) { - if(fmt==LUMINANCE8) + if(fmt==LUMINANCE) { - fmt = R8; + fmt = RED; swiz = R_TO_LUMINANCE; } - else if(fmt==LUMINANCE8_ALPHA8) + else if(fmt==LUMINANCE_ALPHA) { - fmt = RG8; + fmt = RG; swiz = RG_TO_LUMINANCE_ALPHA; } } + if(!get_component_size(fmt) && OES_required_internalformat) + fmt = get_default_sized_pixelformat(fmt); + require_pixelformat(fmt); ifmt = fmt; swizzle = swiz;