I know in VB this was an easy easy easy process.

To lock a surface, get a BYTE array full of each pixel's color value.
Unlock the surface and continue.


I need this to do the most simple alpha blend...fade an image to black.

I got this far myself:

PHP Code:
//--------------------
//Lock a surface
//--------------------
void DDSurface7::Lock()
{
   
m_Surface->Lock(NULL,&m_ddsdLock,DDLOCK_WAIT,NULL);
}


//--------------------
//Unlock the surface
//--------------------
void DDSurface7::Unlock()
{
    
m_Surface->Unlock((LPRECT)m_ddsdLock.lpSurface);
}


//--------------------
//Fill the array
//--------------------
void DDSurface7::FillByteArray()
{    
   if (
m_PixelArraym_PixelArray NULL;

   
   
//m_PixelArray = new BYTE[m_ddsdLock.lPitch * m_ddsdLock.dwHeight];
   
m_PixelArray = (BYTE*)m_ddsdLock.lpSurface;


In order I call the Lock()
Then I call FillByteArray. I then run a loop on m_PixelArray somewhere else in the program and it ALWAYS has a 0 for every value.

What em I doing wrong???