problem updating textures

Hi,

I’m trying to update a texture with glCopyTexSubImage2D() but I get a strange effect…

this is my original texture:
< bug1.gif >

this is what I get :
< bug2.gif >

I’m using a RGBA8 texture. I checked alpha_bits ( = 8 ).

Here’s my code (my window size is 800x600):

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,800,0,600,-1.0f,1.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glDisable(GL_BLEND);
glColorMask(1,1,1,1);
glColor4f(1,1,1,1);
glBindTexture(GL_TEXTURE_2D,tex);
glBegin(GL_QUADS);
glTexCoord2f(0,1);glVertex2f(0,256);
glTexCoord2f(0,0);glVertex2f(0,0);
glTexCoord2f(1,0);glVertex2f(256,0);
glTexCoord2f(1,1);glVertex2f(256,256);
glEnd();
glBindTexture(GL_TEXTURE_2D,tex);
glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,40,40,256,256);

Thanks…

Manuel

sorry, I mean:

glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,256,256);

I dont see the creatation of the texture… it seems like the texture isnt 256 pixels wide… only 32 or so ( the effect comes from bilienar filter)

Originally posted by Mazy:
I dont see the creatation of the texture… it seems like the texture isnt 256 pixels wide… only 32 or so ( the effect comes from bilienar filter)

I’m sure texture is 256x256… and I checked with glGet(witdh,height,components)…

Manuel