PDA

View Full Version : glCompressedTexSubImage2DARB ...



ToF_Fou
03-08-2002, 12:24 AM
I try to subload a compressed texture, but glCompressedTexSubImage2DARB return an error : GL_INVALIB_OPERATION, why ?

How can i subload a compressed texture ?
Can you show me a sample ?

ToF_Fou, thx for your help ....

This is a sample of my code :

/*this operation works perfectly*/
glCompressedTexImage2DARB(GL_TEXTURE_2D, 0,dxtcimg->format,dxtcimg->width,dxtcimg->height,0,dxtcimg->size, dxtcimg->pixels);

glPixelStorei(GL_UNPACK_ROW_LENGTH, dxtcimg->width);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
/*return with glGetError a GL_INVALID_OPERATION*/

glCompressedTexSubImage2DARB(
GL_TEXTURE_2D,0, 256, 256, 128, 128,
dxtcimg->format, dxtcimg->size, dxtcimg->pixels);

ToF_Fou
03-08-2002, 12:25 AM
PS : for this sample my texture is 512X512 DXT5 compressed

ToF_Fou
03-11-2002, 02:50 AM
glCompressedTexSubImage2DARB(
GL_TEXTURE_2D,0, 256, 256, 128, 128,
dxtcimg->format, 128*128/2 /*if DXT3or5 128*128 */, dxtcimg->pixels);
I have a alignement problem ...

Anyone can help me to understand that ? Or Anyone can give me an example of compressed texture subload !!


Please,

Thx

ToF_Fou