SvgaLib/doc/man3/vga_getmodenumber.3

64 lines
1.9 KiB
Groff

.TH vga_getmodenumber 3 "8 April 1998" "Svgalib 1.3.0" "Svgalib User Manual"
.SH NAME
vga_getmodenumber \- return a number for the given video mode
.SH SYNOPSIS
.B "#include <vga.h>"
.BI "int vga_getmodenumber(char *" name );
.SH DESCRIPTION
The function parses
.I *name
and tries to find a videomode corresponding on it.
.I *name
is parsed case insensitive and should be either an integer string just giving a
mode number or
consist of
a capital
.B G
followed by the
.BR "amount of x pixels" ,
followed by a lower case
.BR x ,
followed by the
.BR "amount of y pixels" ,
followed by a lower case
.BR x .
Finally the number of different colors is appended. Here the shortcuts
.BR 32K , 64K , 16M ", and " 16M4
are used for 32768, 65536, and 16777216 are used. The last refers also to
16777216 which are store in 4 bytes (highest address byte unused) for easier
screen access.
For unsupported values or the string "PROMPT" the value -1 is returned. Also a
irritating error message is printed to stdout. This is used during parsing the
.B SVGALIB_DEFAULT_MODE
environment variable. Probably it should not be used for anything else.
.SH EXAMPLE
.BR vga_getmodenumber("G640x480x256") " returns " 10.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR vgatest (6),
.BR vga_hasmode (3),
.BR vga_modeinfo (3),
.BR vga_setmode (3),
.BR vga_lastmodenumber (3),
.BR vga_getcurrentmode (3),
.BR vga_getdefaultmode (3),
.BR vga_getmodename (3)
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced function as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.