IDirect3DDevice::Pick

HRESULT Pick(LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer,

LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags,

LPD3DRECT lpRect);

Executes a buffer without performing any rendering, but returns a z-ordered list of offsets to the primitives that cover the rectangle specified by lpRect.

This call fails if the Direct3DExecuteBuffer object is locked.

·Returns D3D_OK if successful, or an error otherwise, which may be one of the following values:

D3DERR_EXECUTE_LOCKED

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

lpDirect3DExecuteBuffer

Address of an execute buffer from which the z-ordered list is retrieved.

lpDirect3DViewport

Address of a viewport in the list of viewports associated with this Direct3DDevice object.

dwFlags

No flags are currently defined for this method.

lpRect

Address of a D3DRECT structure specifying the range of device coordinates to be picked.

If the x1 and x2 members of the structure specified in the lpRect parameter are equal, and the y1 and y2 members are equal, a single pixel is used for picking. The coordinates are specified in device-pixel space.

All Direct3DExecuteBuffer objects must be attached to a Direct3DDevice object in order for this method to succeed.