GfxModeExists ( width,height,depth )
Parameters
|
width - width in pixels, e.g. 1920 height - height in pixels, e.g. 1080 depth - colour depth in bits (use 32 on the modern runtime) |
Description
|
Returns whether the display supports a given fullscreen graphics mode. 1 means the exact width/height/depth combination is available, 0 means it is not. Check before asking Graphics for a fullscreen mode, and fall back to something safe when the answer is no - monitors differ, and asking for a mode that does not exist stops the program with an error. The match is exact, including depth: modern display modes are all 32-bit, so test with depth 32 (a query for 16 returns 0). Windowed modes need no check. If you also want the mode's index number, FindGfxMode does the same lookup and returns it. See also: FindGfxMode, CountGfxModes, Graphics. |
Example
; GfxModeExists Example ; --------------------- ; GfxModeExists returns True if the video card supports a mode Print "Checking some common display modes:" Print "" If GfxModeExists(640,480,32) Then r$="available" Else r$="NOT available" Print "640 x 480 x 32 ..... "+r$ If GfxModeExists(1920,1080,32) Then r$="available" Else r$="NOT available" Print "1920 x 1080 x 32 ... "+r$ If GfxModeExists(12345,678,32) Then r$="available" Else r$="NOT available" Print "12345 x 678 x 32 ... "+r$+" (as expected!)" Print "" Print "Press any key to close the example" WaitKey End
Index