Original Post
I''ve got a screwy locking problem with DirectDraw that has been giving me headaches for two days. I have a class called CSurface that manages a single LPDIRECTDRAWSURFACE7 object. One of the functions does something like this:
CSurface::Squeeze ()
{
if (!bLocked)
Lock ();
// Do stuff to surface...
CSurface *pTemp = new CSurface ();
pTemp->Create ();
pTemp->Fill (0);
}
As you can see, it locks itself, messes with its color data, and then creates a new surface and fills it with black. But the problem is the fill function fails with DDERR_SURFACEBUSY. I know I''m not unlocking the surface, but I''ve never locked the temporary one so I don''t think it should matter. I only lock each surface once every frame.
Does DD only allow one surface to be locked at a time? This is the only logic thing I can come up with...
Thanks!