glGetTexImage not working...

Hi, I’m currently programming a kind of “worms” game where projectiles must make holes in the ground. To make this, I found the idea to set the alpha bytes to 0 around the explosion. Right now, I use .png files with RGBA format, and I have now problem showing them on screen. My problem is the fact that after using glGetTexImage in the following part of code, the pixels are not read (the data pointed isn’t changed), but I get no glError!

Here is the code, and thanks for your help!

int w,h;
GLubyte pixels = new GLubyte[wh*4];
glBindTexture(GL_TEXTURE_2D, TexID);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
delete [] pixels;

Why do you read back your texture images anyway? Just keep the original data you used when calling glTexImage2d and use glTexSubImage2D to update the corresponding texture (after the first call of glTexImage2D) - this should be much faster than reading textures back, change them and writing them again.