Skip to content

CountDisplayModes

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
BlitzLLVM

CountDisplayModes 〔BlitzLLVM〕

CountDisplayModes:Int32 display:Int32
Parameter Mode Type Default Description
display In Int32 required The display number, from 1 to CountDisplays.

Returns: The number of modes, or 0 if the display does not exist.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

The number of modes a display can be set to. The list has every combination of size, depth and refresh rate once, goes from the smallest width to the largest, and has the mode that the display is in now. Ask DisplayModeWidth, DisplayModeHeight, DisplayModeDepth and DisplayModeRefreshRate for what each mode is. This is a BlitzLLVM extension: the originals have no way to ask for more than the main display. CountGfxModes lists the modes of the main display only, and with no rates.

Differences

  • A display number that does not exist gives 0 (an empty text for the name) instead of stopping the program, because a display can be unplugged while the program runs.

Examples

d = PrimaryDisplay()
For m = 1 To CountDisplayModes(d)
	Print DisplayModeWidth(d, m) + " x " + DisplayModeHeight(d, m) + " x " + DisplayModeDepth(d, m) + " at " + DisplayModeRefreshRate(d, m) + " Hz"
Next
WaitKey

Related Commands

CountDisplays 〔BlitzLLVM〕, CountGfxDrivers, CountGfxModes, CountRefreshRates 〔BlitzLLVM〕, DisplayDepth 〔BlitzLLVM〕, DisplayHeight 〔BlitzLLVM〕, DisplayModeDepth 〔BlitzLLVM〕, DisplayModeHeight 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally