- try to add special texture compression types from GL_EXT_texture_sRGB

This commit is contained in:
Mark Vejvoda 2010-10-29 18:54:55 +00:00
parent 2cc28dda5e
commit f0d9357d31

View File

@ -27,6 +27,11 @@ using namespace Shared::Util;
const uint64 MIN_BYTES_TO_COMPRESS = 12;
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
static std::string getSupportCompressedTextureFormatString(int format) {
std::string result = intToStr(format) + "[" + intToHex(format) + "]";
switch(format) {
@ -142,7 +147,7 @@ static std::string getSupportCompressedTextureFormatString(int format) {
case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
result = "GL_COMPRESSED_SLUMINANCE_ALPHA_EXT";
break;
*/
case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
result = "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT";
break;
@ -158,7 +163,7 @@ static std::string getSupportCompressedTextureFormatString(int format) {
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
result = "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT";
break;
/*
case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
result = "GL_COMPRESSED_LUMINANCE_LATC1_EXT";
@ -293,8 +298,13 @@ GLint toCompressionFormatGl(GLint format) {
//GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
//GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
//#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
//#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
switch(format) {
case GL_LUMINANCE:
@ -308,6 +318,9 @@ GLint toCompressionFormatGl(GLint format) {
else if(std::find(supportedCompressionFormats.begin(),supportedCompressionFormats.end(),GL_COMPRESSED_RGB) != supportedCompressionFormats.end()) {
return GL_COMPRESSED_RGB;
}
else if(std::find(supportedCompressionFormats.begin(),supportedCompressionFormats.end(),GL_COMPRESSED_SRGB_S3TC_DXT1_EXT) != supportedCompressionFormats.end()) {
return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
}
else if(std::find(supportedCompressionFormats.begin(),supportedCompressionFormats.end(),GL_COMPRESSED_RGB_FXT1_3DFX) != supportedCompressionFormats.end()) {
return GL_COMPRESSED_RGB_FXT1_3DFX;
}
@ -321,6 +334,9 @@ GLint toCompressionFormatGl(GLint format) {
else if(std::find(supportedCompressionFormats.begin(),supportedCompressionFormats.end(),GL_COMPRESSED_RGBA) != supportedCompressionFormats.end()) {
return GL_COMPRESSED_RGBA;
}
else if(std::find(supportedCompressionFormats.begin(),supportedCompressionFormats.end(),GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) != supportedCompressionFormats.end()) {
return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
}
else if(std::find(supportedCompressionFormats.begin(),supportedCompressionFormats.end(),GL_COMPRESSED_RGBA_FXT1_3DFX) != supportedCompressionFormats.end()) {
return GL_COMPRESSED_RGBA_FXT1_3DFX;
}