32x32 Mouse Cursors

The fg_mousesiz() function controls whether we want to use the default 16x16 cursor size or a 32x32 cursor. Its only parameter defines the cursor width and height in pixels; it must be either 16 or 32.

We create 32x32 cursors in the usual way with fg_mouseptr(), but we must extend the 16x16 screen and cursor masks to 32x32 pixels. This means passing an array of 64 32-bit values (32 screen mask elements followed 32 cursor mask elements) instead of 32 16-bit values (16 screen mask elements and 16 cursor mask elements). For example, we could create a 32x32 square cursor with black perimeter and transparent inner pixels like this:

C/C++:

int Square[] = {
   0x00000000,0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,
   0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,
   0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,
   0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,
   0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,
   0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,
   0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,
   0x7FFFFFFE,0x7FFFFFFE,0x7FFFFFFE,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000,
   0x00000000,0x00000000,0x00000000,0x00000000};

Delphi:

Square : array [1..64] of integer = (
  $00000000,$7FFFFFFE,$7FFFFFFE,$7FFFFFFE,
  $7FFFFFFE,$7FFFFFFE,$7FFFFFFE,$7FFFFFFE,
  $7FFFFFFE,$7FFFFFFE,$7FFFFFFE,$7FFFFFFE,
  $7FFFFFFE,$7FFFFFFE,$7FFFFFFE,$7FFFFFFE,
  $7FFFFFFE,$7FFFFFFE,$7FFFFFFE,$7FFFFFFE,
  $7FFFFFFE,$7FFFFFFE,$7FFFFFFE,$7FFFFFFE,
  $7FFFFFFE,$7FFFFFFE,$7FFFFFFE,$7FFFFFFE,
  $7FFFFFFE,$7FFFFFFE,$7FFFFFFE,$00000000,
  $00000000,$00000000,$00000000,$00000000,
  $00000000,$00000000,$00000000,$00000000,
  $00000000,$00000000,$00000000,$00000000,
  $00000000,$00000000,$00000000,$00000000,
  $00000000,$00000000,$00000000,$00000000,
  $00000000,$00000000,$00000000,$00000000,
  $00000000,$00000000,$00000000,$00000000,
  $00000000,$00000000,$00000000,$00000000);

As before, the first half of this array contains the screen mask, and the second half the cursor mask (in this example, all cursor mask values are zero).

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.