Sets properties for the cursor.
HRESULT SetCursorProperties( UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9 * pCursorBitmap );
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
An operating system cursor is created and used under either of these conditions:
Otherwise, DirectX uses an emulated cursor. An application uses IDirect3DDevice9::SetCursorPosition to move an emulated cursor to follow mouse movement.
It is recommended for applications to always trap WM_MOUSEMOVE events and call DXSetCursorPosition.
Direct3D cursor functions use either GDI cursor or software emulation, depending on the hardware. Users typically want to respond to a WM_SETCURSOR message. For example, they might want to write the message handler as follows:
case WM_SETCURSOR: // Turn off window cursor. SetCursor( NULL ); m_pd3dDevice->ShowCursor( TRUE ); return TRUE; // Prevent Windows from setting cursor to window class cursor. break;
Or, users might want to call the IDirect3DDevice9::SetCursorProperties method if they want to change the cursor.
The application can determine what hardware support is available for cursors by examining appropriate members of the D3DCAPS9 structure. Typically, hardware supports only 32x32 cursors and, when windowed, the system might support only 32x32 cursors. In this case, IDirect3DDevice9::SetCursorProperties still succeeds but the cursor might be reduced to that size. The hot spot is scaled appropriately.
The cursor does not survive when the device is lost. This method must be called after the device is reset.
Header: Declared in D3d9.h.