Hi there!
I'm having a little problem with Direct3D and hope somebody can help me.
I'm trying to access the individual pixels of Direct3D back buffer (IDirect3D8Surface). It works fine in windowed mode but does not work at all in full screen mode (it even crashes).

Here's what I do:

Code:
procedure TDXDirect3DSprites.Lock;
begin
  if not Failed(FDirect3D8Device.GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO,
    FBackBuffer)) then
  begin
    if Failed(FBackBuffer.LockRect(FLockRect, nil, 0)) then
      Exit;
  end
  else
    HandleError(ED3DLockBackBuffer);
  FBackBuffer.GetDesc(FSurfaceDesc);
end;

procedure TDXDirect3DSprites.PutPixel(X, Y: Cardinal; Value: TColor);
var
  Surface: pLongWord;
  PixelColor: TD3DColor;
  I: Integer;
begin
    Surface := Pointer(Integer(FLockRect.pBits) +
      Integer(FLockRect.Pitch * Y) + (X * 4));
    Surface^ := ColorToD3DColor(Value);
end;

procedure TDXDirect3DSprites.Unlock;
begin
  FBackBuffer.UnlockRect;
  FBackBuffer := nil;
end;
I call Lock then PutPixel then Unlock (of course).

FBackBuffer, FLockRect and FSurfaceDesc are public variables.

I know that this only works with 32 bit pixel format... that's not the problem though. The problem is that it works perfectly in windowed mode and doesn't work in fullscreen mode.

Any help is much appreciated!