Functions | |
int | glutEnterGameMode (void) |
int | glutGameModeGet (GLenum pname) |
void | glutGameModeString (const char *string) |
void | glutLeaveGameMode (void) |
Game mode suffers from some serious problems, however.
Replacing game mode with a better design was discussed at some length in early 2004.
There is no way for game mode to report a partial failure.
There is no way to guarantee cleanup if OpenGLUT crashes during game mode---or if the client crashes or directly exits, etc.
Some XFree86 releases, with some drivers, can fail to set the video mode properly, resulting in disasterous failure (an unusable display). This is presently somewhat headed off by a compile-time option, but a runtime option would be better, as there may be cases where the user is willing to put up with the risk for some---and only some---OpenGLUT applications. Since game mode applications are somewhat dim-witted about such user preferences, it seems, an OpenGLUT runtime control could be desirable.
One idea was to decompose gamemode into component parts and implement them separately, where each part then either succeeds totally or fails totally:
Applications could ask for any or all of these separately. Some of this is already apparently intended in unimplemented API entry points inherited from freeglut. However, the meaning of the entry points is undocumented.
|
Enter game mode. Any combination of the following may apply:
|
|
Return the value of a game mode parameter.
If pname is unknown, a warning is printed and a value of -1 is returned.
|
|
Set the game mode display string.
Glancing at old GLUT 3.7, the freeglut codebase that we inherited does not implement more than a single GLUT gamemode ``criteria''. It may not even do that much correctly. In principle, this code lets you set the video dimensions, rendering depth, and video refresh rate. In practice, the combination that you request may be unsupportable and the target host may even refuse to honor any such changes. If you use this function but do not set all options, the following defaults may be substituted for some values:
|
|
Leave game mode, returning to normal desktop mode.
|