Bink SDK 1.5v

# BinkIsSoftwareCursor

The function BinkIsSoftwareCursor determines whether the specified mouse cursor is software-based on the specified DirectDraw surface pointer.

    S32 BinkIsSoftwareCursor(
      LPDIRECTDRAWSURFACE lpDirectDrawSurface,
      HCURSOR cursor
    );

#### In Parameters

lpDirectDrawSurface
  Specifies the surface that you want to check.
cursor
  Specifies the cursor to test.

#### Returns

Returns non-zero if the cursor is software-based, zero if the cursor is hardware-based.

#### Discussion

This function will figure out if the specified mouse cursor is software-based on the given primary surface pointer. If the cursor is software-based, then you must hide the cursor before drawing on the primary surface (or you get mouse trails on the screen). If the cursor is hardware-based, then you don't need to hide it (hiding and showing the mouse will cause the pointer to flash annoyingly - we should avoid it if we can). This is a pretty slow function (you wouldn't believe how complicated the source code is), so try to call it only once at startup time. For example, to manage the cursor when drawing directly to the primary surface under Win32, do something like this:

`

    HCURSOR Cursor = LoadCursor( 0, IDC_ARROW );S32 Soft_cursor = BinkIsSoftwareCursor( lpDDprim, Cursor );
    void Blit_frame( HWND wnd, S32 x, S32 y, S32 w, S32 h ){  S32 count;  DDSURFACEDESC DDSdesc;
      if ( Soft_cursor )    count = BinkCheckCursor( wnd, x, y, w, h );
      lpDDprim->Lock( NULL, &DDSdesc, DDLOCK_WAIT, 0 );
      // do whatever to the primary surface here
      lpDDprim->Unlock( DDSdesc.lpSurface );
      if ( Soft_cursor )    BinkRestoreCursor( count );}

`

Note that under Win32 if you don't know the HCURSOR, but you do know the HWND, you can use the GetClassLong Windows function with the GCL_HCURSOR flag to find the correct HCURSOR value. This function is automatically called inside the high-level BinkBuffer API.

Group: BinkBuffer API
Related Sections: Mouse Cursors
Related Functions: BinkCheckCursor, BinkRestoreCursor
Related Basic Types: HCURSOR, LPDIRECTDRAWSURFACE, S32

For technical support, e-mail Bink1@radgametools.com
© Copyright 1994-2003 RAD Game Tools, Inc. All Rights Reserved.