typedef struct { GR_COORD rows; GR_COORD cols; GR_SIZE xdpcm; GR_SIZE ydpcm; GR_COUNT planes; GR_COUNT bpp; long ncolors; GR_COUNT fonts; GR_BUTTON buttons; GR_KEYMOD modifiers; int pixtype; GR_COORD xpos; GR_COORD ypos; GR_SIZE vs_width; GR_SIZE vs_height; GR_SIZE ws_width; GR_SIZE ws_height; } GR_SCREEN_INFO; |
A GR_SCREEN_INFO structure lets your application determine screen properties at run time. The structure is
Type | Name | Description |
---|---|---|
GR_COORD | rows | The number of rows of pixels on the screen. |
GR_COORD | cols | The number of columns of pixels on the screen. |
GR_SIZE | xdpcm | The number of pixels (dots) per centimeter along the X axis of the screen. |
GR_SIZE | ydpcm | The number of pixels (dots) per centimeter along the Y axis of the screen. |
GR_COUNT | planes | The number of color planes in the graphics hardware. |
GR_COUNT | bpp | The number of bits per pixel in the graphics hardware. |
long | ncolors | The number of colors supported by the hardware. |
GR_COUNT | fonts | The number of built-in fonts. |
GR_BUTTON | buttons | This field indicates the buttons that are available on the system's pointing device. For a touch screen device only a left button is available, for a GPM mouse three butons are available. |
GR_KEYMOD | modifiers | This field indicates the modifier keys that are available on the system's keyboard device. |
int | pixtype | The screen drivers native pixel format. See below for a list of the available pixel formats. |
GR_COORD | xpos | The current position of the mouse along the X axis. |
GR_COORD | ypos | The current position of the mouse along the Y axis. |
GR_SIZE | vs_width | |
GR_SIZE | vs_height | |
GR_SIZE | ws_width | |
GR_SIZE | ws_height |
The following table lists the possible pixel format values that may be returned in the GR_SCREEN_INFO structure. There are two pseudo pixel formats. These formats will never be returned from a screen driver, but they are be used as a data type with the GrArea() function.
Pixel Format | Description |
---|---|
MWPF_RGB | This psuedo format is used as a conversion specifier when working with 32 bit RGB format pixel colors. |
MWPF_PIXELVAL | This psuedo format is used as a no conversion specifier when working with GR_PIXELVAL pixel colors. |
MWPF_PALETTE | Palettized pixel color format. |
MWPF_TRUECOLOR0888 | Packed 32 bit 0/8/8/8 true color format. |
MWPF_TRUECOLOR888 | Packed 24 bit 8/8/8 truecolor format. |
MWPF_TRUECOLOR565 | Packed 16 bit 5/6/5 truecolor format. |
MWPF_TRUECOLOR555 | Packed 16 bit 0/5/5/5 truecolor format. |
MWPF_TRUECOLOR332 | Packed 8 bit 3/3/2 truecolor format. |