| Home
| Previous
| Next
| Up

color256_cursor_t

Declaration

typedef struct {
ulong bitsPerPixel;
uchar colorData[4096];
uchar andMask[512];
palette_t palette[256];
ulong xHotSpot;
ulong yHotSpot;
} color256_cursor_t

Prototype In

mgraph.h

Description

Structure representing a 256-color color mouse cursor. The cursor is defined as a 64x64 image with an AND and XOR mask. The cursor is defined as a 64x64 image with an AND mask and color data. The definition of the AND mask, cursor data and the pixels that will appear on the screen is as follows:

AND Color Result
0 00 Transparent (color from screen memory)
0 FF Invert (complement of color from screen memory)
1 xx Cursor color data

Hence if the AND mask is a zero the color data should be either 00 or FF to either make the pixel transparent or the inversion of the screen pixel. Any other value will produce an undefined result.

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 (8 in this case)
colorData | Cursor color data as a 64x64 array of packed 8-bit pixels
andMask | Cursor AND mask
palette | 256-color palette for cursor image
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