Supported Browsers Home   
colorRGBA_cursor_t Previous   
color_t Next   
Type Definitions Up   

colorRGB_cursor_t

Declaration

typedef struct {
    ulong       bitsPerPixel;
    uchar       colorData[12288];
    uchar       andMask[512];
    ulong       xHotSpot;
    ulong       yHotSpot;
    } colorRGB_cursor_t

Prototype In

mgraph.h

Description

Hardware 24-bit cursor structure. This structure defines a color hardware cursor that is downloaded to the hardware. 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   0       Transparent (color from screen memory)
0   not 0   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 to make the pixel transparent or not 0 to make it the inversion of the screen pixel.

The color data is passed down to the driver as 24-bit packed RGB color values. It is up to the calling application to translate cursor images of lower color depths to the format supported by the hardware.

The HotX and HotY 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 (24 in this case)

colorData

Cursor color data as a 64x64 array of packed 24-bit pixels

andMask

Cursor AND mask

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