<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Graphics.UI.GLUT.GameMode</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_Graphics-UI-GLUT-GameMode.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-UI-GLUT-GameMode.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">GLUT-2.1.2.1: A binding for the OpenGL Utility Toolkit</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>stable</td></tr><tr><th>Maintainer</th><td>sven.panne@aedion.de</td></tr></table><p class="caption">Graphics.UI.GLUT.GameMode</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>In addition to the functionality offered by <code>Graphics.UI.GLUT.Window.fullScreen</code>, GLUT offers an sub-API to change the screen resolution, color depth, and refresh rate of the display for a single full screen window. This mode of operation is called <em>game mode</em>, and is restricted in various ways: No pop-up menus are allowed for this full screen window, no other (sub-)windows can be created, and all other applications are hidden. </p><p><em>X Implementation Notes:</em> Note that game mode is not fully supported in the original GLUT for X, it is essentially the same as using <code>Graphics.UI.GLUT.Window.fullScreen</code>. The GLUT clone freeglut (see <a href="http://freeglut.sourceforge.net/">http://freeglut.sourceforge.net/</a>) does not have this restriction. </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:GameModeCapability">GameModeCapability</a> <ul class="subs"><li>= <a href="#v:GameModeWidth">GameModeWidth</a> </li><li>| <a href="#v:GameModeHeight">GameModeHeight</a> </li><li>| <a href="#v:GameModeBitsPerPlane">GameModeBitsPerPlane</a> </li><li>| <a href="#v:GameModeRefreshRate">GameModeRefreshRate</a> </li><li>| <a href="#v:GameModeNum">GameModeNum</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:GameModeCapabilityDescription">GameModeCapabilityDescription</a> = <a href="#v:Where-39-">Where'</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapability">GameModeCapability</a> <a href="Graphics-UI-GLUT-Initialization.html#t:Relation">Relation</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:gameModeCapabilities">gameModeCapabilities</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:SettableStateVar">SettableStateVar</a> [<a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapabilityDescription">GameModeCapabilityDescription</a>]</li><li class="src short"><a href="#v:enterGameMode">enterGameMode</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="Graphics-UI-GLUT-Window.html#t:Window">Window</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a>)</li><li class="src short"><a href="#v:leaveGameMode">leaveGameMode</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:BitsPerPlane">BitsPerPlane</a> = <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:RefreshRate">RefreshRate</a> = <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:GameModeInfo">GameModeInfo</a> = <a href="#v:GameModeInfo">GameModeInfo</a> <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-CoordTrans.html#t:Size">Size</a> <a href="Graphics-UI-GLUT-GameMode.html#t:BitsPerPlane">BitsPerPlane</a> <a href="Graphics-UI-GLUT-GameMode.html#t:RefreshRate">RefreshRate</a></li><li class="src short"><a href="#v:gameModeInfo">gameModeInfo</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeInfo">GameModeInfo</a>)</li><li class="src short"><a href="#v:gameModeActive">gameModeActive</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:GameModeCapability" class="def">GameModeCapability</a> <a href="src/Graphics-UI-GLUT-GameMode.html#GameModeCapability" class="link">Source</a></p><div class="doc"><p>Capabilities for <code><a href="Graphics-UI-GLUT-GameMode.html#v:gameModeCapabilities">gameModeCapabilities</a></code> </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:GameModeWidth" class="def">GameModeWidth</a></td><td class="doc"><p>Width of the screen resolution in pixels </p></td></tr><tr><td class="src"><a name="v:GameModeHeight" class="def">GameModeHeight</a></td><td class="doc"><p>Height of the screen resolution in pixels </p></td></tr><tr><td class="src"><a name="v:GameModeBitsPerPlane" class="def">GameModeBitsPerPlane</a></td><td class="doc"><p>Color depth of the screen in bits </p></td></tr><tr><td class="src"><a name="v:GameModeRefreshRate" class="def">GameModeRefreshRate</a></td><td class="doc"><p>Refresh rate in Hertz </p></td></tr><tr><td class="src"><a name="v:GameModeNum" class="def">GameModeNum</a></td><td class="doc"><p>Match the Nth frame buffer configuration compatible with the given capabilities (numbering starts at 1) </p></td></tr></table></div><div class="subs instances"><p id="control.i:GameModeCapability" class="caption collapser" onclick="toggleSection('i:GameModeCapability')">Instances</p><div id="section.i:GameModeCapability" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapability">GameModeCapability</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapability">GameModeCapability</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapability">GameModeCapability</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:GameModeCapabilityDescription" class="def">GameModeCapabilityDescription</a> <a href="src/Graphics-UI-GLUT-GameMode.html#GameModeCapabilityDescription" class="link">Source</a></p><div class="doc"><p>A single capability description for <code><a href="Graphics-UI-GLUT-GameMode.html#v:gameModeCapabilities">gameModeCapabilities</a></code>. </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Where-39-" class="def">Where'</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapability">GameModeCapability</a> <a href="Graphics-UI-GLUT-Initialization.html#t:Relation">Relation</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:GameModeCapabilityDescription" class="caption collapser" onclick="toggleSection('i:GameModeCapabilityDescription')">Instances</p><div id="section.i:GameModeCapabilityDescription" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapabilityDescription">GameModeCapabilityDescription</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapabilityDescription">GameModeCapabilityDescription</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapabilityDescription">GameModeCapabilityDescription</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:gameModeCapabilities" class="def">gameModeCapabilities</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:SettableStateVar">SettableStateVar</a> [<a href="Graphics-UI-GLUT-GameMode.html#t:GameModeCapabilityDescription">GameModeCapabilityDescription</a>]<a href="src/Graphics-UI-GLUT-GameMode.html#gameModeCapabilities" class="link">Source</a></p><div class="doc"><p>Controls the <em>game mode</em> to be used when <code><a href="Graphics-UI-GLUT-GameMode.html#v:enterGameMode">enterGameMode</a></code> is called. It is described by a list of zero or more capability descriptions, which are translated into a set of criteria used to select the appropriate screen configuration. The criteria are matched in strict left to right order of precdence. That is, the first specified criterion (leftmost) takes precedence over the later criteria for non-exact criteria (<code><a href="Graphics-UI-GLUT-Initialization.html#v:IsGreaterThan">IsGreaterThan</a></code>, <code><a href="Graphics-UI-GLUT-Initialization.html#v:IsLessThan">IsLessThan</a></code>, etc.). Exact criteria (<code><a href="Graphics-UI-GLUT-Initialization.html#v:IsEqualTo">IsEqualTo</a></code>, <code><a href="Graphics-UI-GLUT-Initialization.html#v:IsNotEqualTo">IsNotEqualTo</a></code>) must match exactly so precedence is not relevant. </p><p>To determine which configuration will actually be tried by <code><a href="Graphics-UI-GLUT-GameMode.html#v:enterGameMode">enterGameMode</a></code> (if any), use <code><a href="Graphics-UI-GLUT-GameMode.html#v:gameModeInfo">gameModeInfo</a></code>. </p><p>Note that even for game mode the current values of <code>Graphics.UI.GLUT.Initialization.initialDisplayMode</code>or <code>Graphics.UI.GLUT.Initialization.initialDisplayCapabilities</code> will determine which buffers are available, if double buffering is used or not, etc. </p></div></div><div class="top"><p class="src"><a name="v:enterGameMode" class="def">enterGameMode</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="Graphics-UI-GLUT-Window.html#t:Window">Window</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a>)<a href="src/Graphics-UI-GLUT-GameMode.html#enterGameMode" class="link">Source</a></p><div class="doc"><p>Enter <em>game mode</em>, trying to change resolution, refresh rate, etc., as specified by the current value of <code><a href="Graphics-UI-GLUT-GameMode.html#v:gameModeCapabilities">gameModeCapabilities</a></code>. An identifier for the game mode window and a flag, indicating if the display mode actually changed, are returned. The game mode window is made the <em>current window</em>. </p><p>Re-entering <em>game mode</em> is allowed, the previous game mode window gets destroyed by this, and a new one is created. </p></div></div><div class="top"><p class="src"><a name="v:leaveGameMode" class="def">leaveGameMode</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-GLUT-GameMode.html#leaveGameMode" class="link">Source</a></p><div class="doc"><p>Leave <em>game mode</em>, restoring the old display mode and destroying the game mode window. </p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:BitsPerPlane" class="def">BitsPerPlane</a> = <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-GLUT-GameMode.html#BitsPerPlane" class="link">Source</a></p><div class="doc"><p>The color depth of the screen, measured in bits (e.g. 8, 16, 24, 32, ...) </p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:RefreshRate" class="def">RefreshRate</a> = <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-GLUT-GameMode.html#RefreshRate" class="link">Source</a></p><div class="doc"><p>The refresh rate of the screen, measured in Hertz (e.g. 60, 75, 100, ...) </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:GameModeInfo" class="def">GameModeInfo</a> <a href="src/Graphics-UI-GLUT-GameMode.html#GameModeInfo" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:GameModeInfo" class="def">GameModeInfo</a> <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-CoordTrans.html#t:Size">Size</a> <a href="Graphics-UI-GLUT-GameMode.html#t:BitsPerPlane">BitsPerPlane</a> <a href="Graphics-UI-GLUT-GameMode.html#t:RefreshRate">RefreshRate</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:GameModeInfo" class="caption collapser" onclick="toggleSection('i:GameModeInfo')">Instances</p><div id="section.i:GameModeInfo" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeInfo">GameModeInfo</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeInfo">GameModeInfo</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeInfo">GameModeInfo</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:gameModeInfo" class="def">gameModeInfo</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-GLUT-GameMode.html#t:GameModeInfo">GameModeInfo</a>)<a href="src/Graphics-UI-GLUT-GameMode.html#gameModeInfo" class="link">Source</a></p><div class="doc"><p>Return <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#v:Just">Just</a></code> the mode which would be tried by the next call to <code><a href="Graphics-UI-GLUT-GameMode.html#v:enterGameMode">enterGameMode</a></code>. Returns <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if the mode requested by the current value of <code><a href="Graphics-UI-GLUT-GameMode.html#v:gameModeCapabilities">gameModeCapabilities</a></code> is not possible, in which case <code><a href="Graphics-UI-GLUT-GameMode.html#v:enterGameMode">enterGameMode</a></code> would simply create a full screen window using the current mode. </p></div></div><div class="top"><p class="src"><a name="v:gameModeActive" class="def">gameModeActive</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a><a href="src/Graphics-UI-GLUT-GameMode.html#gameModeActive" class="link">Source</a></p><div class="doc"><p>Contains <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:True">True</a></code> when the <em>game mode</em> is active, <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:False">False</a></code> otherwise. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>