glutGameModeString

sets the game mode configuration via a string.

Signature

glutGameModeString( const char( string ) )-> void
glutGameModeString( string )
glutGameModeString( STRING(string) ) -> None

Parameters

VariablesDescription
string
ASCII string for selecting a game mode configuration.

Description

glutGameModeString sets the game mode configuration via an ASCII string. The game mode configuration string for GLUT's fullscreen game mode describes the suitable screen width and height in pixels, the pixel depth in bits, and the video refresh frequency in hertz. The game mode configuration string can also specify a window system dependent display mode.
The string is a list of zero or more capability descriptions seperated by spaces and tabs. Each capability description is a capability name that is followed by a comparator and a numeric value. (Unlike the display mode string specified using glutInitDisplayString , the comparator and numeric value are not optional.) For example, "width>=640" and "bpp=32" are both valid criteria.
The capability descriptions are translated into a set of criteria used to select the appropriate game mode configuration.
The criteria are matched in strict left to right order of precdence. That is, the first specified criteria (leftmost) takes precedence over the later criteria for non-exact criteria (greater than, less than, etc. comparators). Exact criteria (equal, not equal compartors) must match exactly so precedence is not relevant.
The numeric value is an integer that is parsed according to ANSI C's strtol(str, strptr, 0) behavior. This means that decimal, octal (leading 0), and hexidecimal values (leading 0x) are accepeted. The valid compartors are:
=
Equal.
!=
Not equal.
<
Less than and preferring larger difference (the least is best).
>
Greater than and preferring larger differences (the most is best).
<=
Less than or equal and preferring larger difference (the least is best).
>=
Greater than or equal and preferring more instead of less. This comparator is useful for allocating resources like color precsion or depth buffer precision where the maximum precison is generally preferred. Contrast with the tilde (~) comprator.
~
Greater than or equal but preferring less instead of more. This compartor is useful for allocating resources such as stencil bits or auxillary color buffers where you would rather not over allocate.
The valid capability names are:
bpp
Bits per pixel for the frame buffer.
height
Height of the screen in pixels.
hertz
Video refresh rate of the screen in hertz.
num
Number of the window system depenedent display mode configuration.
width
Width of the screen in pixels.
An additional compact screen resolution description format is supported. This compact description convienently encodes the screen resolution description in a single phrase. For example, "640x480:16@60" requests a 640 by 480 pixel screen with 16 bits per pixel at a 60 hertz video refresh rate. A compact screen resolution description can be mixed with conventional capability descriptions.
The compact screen resolution description format is as follows:
[ width "x" height ][ ":" bitsPerPixel ][ "@" videoRate ]
Unspecifed capability descriptions will result in unspecified criteria being generated. These unspecified criteria help glutGameModeString behave sensibly with terse game mode description strings.

See Also

glutGameModeGet glutEnterGameMode glutLeaveGameMode glutInitDisplayString

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glutGameModeString
{LGPL} PyUI2 renderers/openglGlut.py Lines: 49
{LGPL} PyUI2 system/glutdevice.py Lines: 45