   LOCK RECT FAIL
  hi all, i have code :g_pd3dDevice->GetDepthStencilSurface( &pRenderSurface )if (FAILED(pRenderSurface->LockRect(&lockedRect, NULL, D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK))) { MessageBox (g_hWnd_1, "Lock failed0", "ERROR", MB_OK);}it fail, pls help me????? thanks very muchDavid,   
  Generally speaking you can't lock a depth/stencil buffer. Only if it's created with D3DFMT_D16_LOCKABLE will this call succeed. However, hardware support for that format is far from universal...Your best solution is to use some form of "render to texture" effect to try and extract the information you desire. Locking a render target is fairly straight forward and doesn't tend to have format restrictions.Also, two minor requests from your friendly neighbourhood moderator [wink] - an ALL CAPITALS subject title isn't necessary. - Small fragments of code like you posted are best off in  ...  blocksCheers,Jack   