Skip to content

SCREENLIST


Finds available fullscreen video modes

Syntax

` declare function Screenlist ( byval depth as long = 0 ) as long

`

Usage

` result = Screenlist( [ depth ] )

`

Parameters

depth

the color depth for which the list of modes is requested (supported depths are 8, 15, 16, 24 and 32)

Return Value

returns 0, when there are no more resolutions to read.

Description

It works like the Dir function: the first call to the function requires the depth parameter to be specified, it returns the lowest supported resolution for the requested depth. Further calls to Screenlist without arguments returns the next resolutions. When no more resolutions are available, Screenlist returns 0.

The result of Screenlist is encoded as a 32 bit value, with the screen width as the high word and the height as the low word.

Resolutions are returned from lowest to highest supported ones.

It is safe to call this function before any graphics mode has been set.

Examples

start GeSHi

vb
Dim As Long mode
Dim As UInteger w, h

Print "Resolutions supported at 8 bits per pixel:"

mode = ScreenList(8)
While (mode <> 0)
    w = HiWord(mode)
    h = LoWord(mode)
    Print w & "x" & h
    mode = ScreenList()
Wend

end GeSHi

Dialect Differences

  • Not available in the -lang qb dialect unless referenced with the alias __Screenlist.

Differences from QB

  • New to FreeBASIC

See also

  • Screen (Graphics)
  • Screenres

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft