MGL_findMode

Finds the number of a mode given the resolution and color depth.

Declaration

int MGLAPI MGL_findMode(
    int xRes,
    int yRes,
    int bitsPerPixel)

Prototype In

mgraph.h

Parameters

xRes

Horizontal resolution for the display mode in pixels

yRes

Vertical resolution for the display mode in lines

bitsPerPixel

Color depth for the display mode

 

Return Value

MGL mode number for the mode, or -1 if not found.

Description

This function searches the list of available display modes in the MGL, looking for one that matches the specified resolution and color depth. This function is useful if your application always runs in a specific resolution and color depth, allowing you to quickly initialise the MGL without needing to write your own code to search the list of available modes.

Note:    If the hardware has not been detected when this call is made, the MGL will automatically detect the installed hardware the first time this function is called.

See Also

MGL_init, MGL_availablePages, MGL_modeResolution, MGL_modeFlags, MGL_createDisplayDC

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