Hello Guest

Saving compressed textures

  • 0 Replies
  • 80 Views
*

Offline exp_function

  • *
  • 1
  • Queen
Saving compressed textures
« on: June 30, 2020, 23:18:53 »
Hi,
I'm trying to get the compressed pixels using;
Code: [Select]
glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texBuff);
int comSiz =  glGetTexLevelParameteri(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
ByteBuffer comBuf = ByteBuffer.allocateDirect(comSiz);
byte[] comByt = new byte[comSiz];
glGetCompressedTexImage(GL_TEXTURE_2D, 0, comBuf);
comBuf.get(comByt, 0, comSiz);

but I can only read zero values from both comByt and comBuf buffers. What could be the reason for that?
Thanks.