Of course i will do:
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
for(nMIPMapLevel = 0; nMIPMapLevel <= nTextureLevelsNeeded; nSizeX = PVRT_MAX(nSizeX/2, (unsigned int)1), nSizeY = PVRT_MAX(nSizeY/2, (unsigned int)1), nMIPMapLevel++)
 {
 if (format == GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG || format == GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG)
 {
 CompressedImageSize = ( PVRT_MAX(nSizeX, PVRTC2_MIN_TEXWIDTH) * PVRT_MAX(nSizeY, PVRTC2_MIN_TEXHEIGHT) * bitcount + 7) / 8;
 }
 else
 {// PVRTC4 case
 CompressedImageSize = ( PVRT_MAX(nSizeX, PVRTC4_MIN_TEXWIDTH) * PVRT_MAX(nSizeY, PVRTC4_MIN_TEXHEIGHT) * bitcount + 7) / 8;
 }
 Â
 glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );Â
Â
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
 GL_REPEAT );
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
 GL_REPEAT );
 glCompressedTexImage2D(GL_TEXTURE_2D, nMIPMapLevel, format, nSizeX, nSizeY, 0,
 CompressedImageSize, data);
}
[/CODE]
Best Regards
EDIT: All other textures are shown well with this code. Problems only occur with thouse which should be blended over textures alpha channel
Lichtens2009-06-09 07:44:09[CODE]
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
for(nMIPMapLevel = 0; nMIPMapLevel <= nTextureLevelsNeeded; nSizeX = PVRT_MAX(nSizeX/2, (unsigned int)1), nSizeY = PVRT_MAX(nSizeY/2, (unsigned int)1), nMIPMapLevel++)
 {
 if (format == GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG || format == GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG)
 {
 CompressedImageSize = ( PVRT_MAX(nSizeX, PVRTC2_MIN_TEXWIDTH) * PVRT_MAX(nSizeY, PVRTC2_MIN_TEXHEIGHT) * bitcount + 7) / 8;
 }
 else
 {// PVRTC4 case
 CompressedImageSize = ( PVRT_MAX(nSizeX, PVRTC4_MIN_TEXWIDTH) * PVRT_MAX(nSizeY, PVRTC4_MIN_TEXHEIGHT) * bitcount + 7) / 8;
 }
 Â
 glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );Â
Â
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
 GL_REPEAT );
 glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
 GL_REPEAT );
 glCompressedTexImage2D(GL_TEXTURE_2D, nMIPMapLevel, format, nSizeX, nSizeY, 0,
 CompressedImageSize, data);
}
[/CODE]
Best Regards
EDIT: All other textures are shown well with this code. Problems only occur with thouse which should be blended over textures alpha channel
Lichtens2009-06-09 07:44:09