MGL_addCustomMode

Adds a new custom display mode to the mode list

Declaration

ibool MGLAPI MGL_addCustomMode(
    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

True on success, false on failure.

Description

This function attempts to use the SciTech SNAP Graphics API functions to create a new custom display mode. If the custom display mode creation succeeds, this function returns true. If it fails it returns false. The most common scenario for the failure to create a custom display mode, is that the requested mode is not compatible with the underlying hardware. In this case you may want to search for a compatible mode by stepping the X resolution in 8 pixel increments until you find a suitable mode that is larger than what you want.

Note:    Some display hardware will require that the X resolution be aligned on a 16 pixel boundary, so might fail if you try to set a mode that where the X resolution is not divisible by 16. Hence we advise that when you create new modes you try to use modes that are divisible by 16 to ensure they will work on all available hardware devices.

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, MGL_findMode

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