the following code is used to draw a black transparent square hole into a 2d (to simulate bits of level getting blown up!).
the problem is: the level remains unchanged
//vars: l, r, t, b (left, right, top, bottom) are long’s and are definately within the bounds of the texture
unsigned char* pixel = NULL;
for(int x=l; x<r; ++x)
for(int y=t; y<b; ++y)
pixel = &m_image->Bytes[(ym_image->Widthm_image->BytesPerPixel) + (x*m_image->BytesPerPixel)];
*(pixel+0) = 0;
*(pixel+1) = 0;
*(pixel+2) = 0;
*(pixel+3) = 0;
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_image->Width, m_image->Height, GL_RGBA, GL_UNSIGNED_BYTE, m_image->Bytes);
//gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, m_image->Width, m_image->Height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, m_image->Bytes);
if i use the commented gluBuild2DMipMaps line instead of texsubimage, it works (but is slooooow) which verifies the validity of m_image.
im not concerned with any optimisations for now - just getting it working at a decent speed (ie not using build2dmips func).