   Saving a compressed cube map
  Hey!I'm trying to store a compressed cube map texture to a file. According to the texture compression extension, it is possible to read the image data of each face by the command glGetCompressedTexImage(target, level, buffer), where target  can be GL_TEXTURE_CUBE_MAP_POSITIVE_X+nFace, nFace=0..5. However, if I try to do this AFTER generating all 6 faces, only the 6th face is stored to disk, no matter what target I enter. Look at the following snipped (reduced to the minimum):const int W=256, H=256;int nFace, target, format;unsigned char buff[W*H];int imgSize;unsigned char *buffer;FILE *FID;// Generate some dummy cube map textureglGenTextures(1, &starCubemap);glBindTexture(GL_TEXTURE_CUBE_MAP, starCubemap);for (nFace=0; nFace<6; nFace++){target = GL_TEXTURE_CUBE_MAP_POSITIVE_X+nFace;for (int n=0; n<W*H; n++)buff[n] = (rand()%256) * (nFace+1) / 6;glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+nFace, 0, GL_COMPRESSED_RGB, W, H, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, buff);free(buffer);}// Store it to diskfor (nFace=0; nFace<6; nFace++){char filename[] = "Resource/testx.cpr";filename[13] = '1'+nFace;target = GL_TEXTURE_CUBE_MAP_POSITIVE_X+nFace;FID = fopen(filename, "wb");// Get size and image dataglGetTexLevelParameteriv(target, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &imgSize);buffer = (unsigned char*)malloc(imgSize*sizeof(unsigned char));glGetCompressedTexImage(target, 0, buffer);fwrite(&imgSize, sizeof(int), 1, FID);fwrite(buffer,   imgSize,1, FID);free(buffer);fclose(FID);}Here, only the 6th face is saved to all 6 files (so they are all the same). If I merge the two for-loops, so that the compressed textures are queried right after creation, the code works fine, i.e. all 6 faces are saved.Does anyone know why this is the case?Thanks in advance,  Lutz   
  Anyone?   