Supported Browsers Home   
metrics_t Previous   
palette_ext_t Next   
Type Definitions Up   

mono_cursor_t

Declaration

typedef struct {
    ulong       bitsPerPixel;
    uchar       xorMask[512];
    uchar       andMask[512];
    ulong       xHotSpot;
    ulong       yHotSpot;
    } mono_cursor_t

Prototype In

mgraph.h

Description

Structure representing a monochrome or 2-color mouse cursor. The cursor is defined as a 64x64 image with an AND and XOR mask. The definition of the AND mask, XOR mask and the pixels that will appear on the screen is as follows (same as the Microsoft Windows cursor format):

AND XOR Result
0   0   Transparent (color from screen memory)
0   1   Invert (complement of color from screen memory)
1   0   Cursor background color
1   1   Cursor foreground color

The xHotSpot and yHotSpot members define the hot-spot for the cursor, which is the location where the logical mouse pointer is located in the cursor image. When you click the mouse, the pixel under the hot-spot is the pixel selected.

Note that Microsoft Windows cursors stored on disk are generally 32x32 in size, and the MGL will convert them during loading to the 64x64 internal format. The MGL does however support loading 64x64 cursors, but you may need to manually create these yourself as Windows resource editors appear to be hard coded to use 32x32 cursors.

Members

bitsPerPixel

Indicates the number of bits per pixel for cursor (1 in this case)

xorMask

64x64 bit XOR pixel mask

andMask

64x64 bit AND pixel mask (see note above)

xHotSpot

x coordinate of the mouse hotspot location. The mouse hotspot location is used to properly align the mouse cursor image to the actual mouse cursor position on the screen

yHotSpot

y coordinate of the mouse hotspot location

 

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com