compressing already compressed image in android open gl

105 views Asked by At

I want to compress already compressed images and pass the final double compressed data to glCompressedTexImage2D. For this I have followed below steps:

glGenTextures(1, textureID);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(GL_TEXTURE_2D, level, internalformat, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
&compressedSize );
if (compressedSize > 0){
/* call glCompressedTexImage2D to render this double compressed image.*/
}

But I am getting only 0 in compressedSize. Seems the data is not getting compressed.

1

There are 1 answers

2
Columbo On

GL_TEXTURE_COMPRESSED_IMAGE_SIZE isn't part of the OpenGLES 2 spec (or even OpenGLES 3.0 or 3.1)