Partager via


IDirect3DDevice8::SetCursorPosition

This method sets the cursor position and update options.

void SetCursorPosition(
  UINT XScreenSpace,
  UINT YScreenSpace,
  DWORD Flags
);

Parameters

  • XScreenSpace
    [in] The new X-position of the cursor in screen-space coordinates. See Remarks.

  • YScreenSpace
    [in] The new Y-position of the cursor in screen-space coordinates. See Remarks.

  • Flags
    [in] Specifies the update options for the cursor. Currently, only one flag is defined, D3DCURSOR_IMMEDIATE_UPDATE.

    If this flag is specified, the system guarantees that the cursor will be updated at a minimum of half the display refresh rate, but never more frequently than the display refresh rate. Otherwise, the method delays cursor updates until the next IDirect3DDevice8::Present call.

    Not setting this flag usually results in better performance than if the flag is set. However, applications should set this flag if the rate of calls to Present is low enough that users would notice a significant delay in cursor motion. This flag has no effect in a windowed-mode application. Some video cards implement hardware color cursor. This flag does not have effect on these cards.

Return Values

None.

Remarks

When running in full-screen mode, screen-space coordinates are the back-buffer coordinates appropriately scaled to the current display mode. When running in windowed mode, screen-space coordinates are the desktop coordinates. The cursor image is drawn at the specified position minus the hotspot offset specified by the IDirect3DDevice8::SetCursorProperties method.

If the cursor has been hidden by IDirect3DDevice8::ShowCursor, then the cursor is not drawn.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: D3d8.h.
Link Library: D3d8.lib.

See Also

IDirect3DDevice8::Present | IDirect3DDevice8::SetCursorProperties | IDirect3DDevice8::ShowCursor | IDirect3DDevice8

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.