Managed DirectDraw
-
Hi, I'm trying to direct acces to MDDraw surface memory. I'm using Lock() method but I don't understand it. I was doing same thing in C++ and DX7.. Unmanaged Lock() returns pointer to memory and informations about format, but managed Lock() returns 2-dimensional array of byte (width and height of this array is same as size of the surface, but this is not enough for saving color in 32bit format). Following code does nothing: :~
Byte[,] btData=surfaceBack.Lock(LockFlags.SurfaceMemoryPointer|LockFlags.Wait);
for(int x=0; x<100; x++)
{
for (int y=0; y<100; y++)
{
btData[x,y]=(byte)x;
}
}
srfBack.Unlock(btData);:confused: Thank you for help. [edit]:| MSDN :
Surface.Lock()
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.directdraw/c/surface/m/lock0.asp[^][/edit] i'm only pointer to myself