<!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.Overlay</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-Overlay.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-UI-GLUT-Overlay.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.Overlay</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Overlay creation and destruction </a></li><li><a href="#g:2">Showing and hiding an overlay </a></li><li><a href="#g:3">Changing the <em>layer in use</em> </a></li><li><a href="#g:4">Re-displaying </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>When overlay hardware is available, GLUT provides a set of routines for establishing, using, and removing an overlay for GLUT windows. When an overlay is established, a separate OpenGL context is also established. A window's overlay OpenGL state is kept distinct from the normal planes' OpenGL state. </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"><a href="#v:hasOverlay">hasOverlay</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</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:overlayPossible">overlayPossible</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><li class="src short"><a href="#v:overlayVisible">overlayVisible</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="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Layer">Layer</a> <ul class="subs"><li>= <a href="#v:Normal">Normal</a> </li><li>| <a href="#v:Overlay">Overlay</a> </li></ul></li><li class="src short"><a href="#v:layerInUse">layerInUse</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-UI-GLUT-Overlay.html#t:Layer">Layer</a></li><li class="src short"><a href="#v:postOverlayRedisplay">postOverlayRedisplay</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-Window.html#t:Window">Window</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></ul></div><div id="interface"><h1 id="g:1">Overlay creation and destruction </h1><div class="top"><p class="src"><a name="v:hasOverlay" class="def">hasOverlay</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</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-Overlay.html#hasOverlay" class="link">Source</a></p><div class="doc"><p>Controls the overlay for the <em>current window</em>. The requested display mode for the overlay is determined by the <em>initial display mode</em>. <code><a href="Graphics-UI-GLUT-Overlay.html#v:overlayPossible">overlayPossible</a></code> can be used to determine if an overlay is possible for the <em>current window</em> with the current <em>initial display mode</em>. Do not attempt to establish an overlay when one is not possible; GLUT will terminate the program. </p><p>When <code><a href="Graphics-UI-GLUT-Overlay.html#v:hasOverlay">hasOverlay</a></code> is set to <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:True">True</a></code> when an overlay already exists, the existing overlay is first removed, and then a new overlay is established. The state of the old overlay's OpenGL context is discarded. Implicitly, the window's <em>layer in use</em> changes to the overlay immediately after the overlay is established. </p><p>The initial display state of an overlay is shown, however the overlay is only actually shown if the overlay's window is shown. </p><p>Setting <code><a href="Graphics-UI-GLUT-Overlay.html#v:hasOverlay">hasOverlay</a></code> to <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:False">False</a></code> is safe even if no overlay is currently established, nothing happens in this case. Implicitly, the window's /layer in use/ changes to the normal plane immediately once the overlay is removed. </p><p>If the program intends to re-establish the overlay later, it is typically faster and less resource intensive to use <code><a href="Graphics-UI-GLUT-Overlay.html#v:overlayVisible">overlayVisible</a></code> to simply change the display status of the overlay. </p><p><em>X Implementation Notes:</em> GLUT for X uses the <code>SERVER_OVERLAY_VISUALS</code> convention to determine if overlay visuals are available. While the convention allows for opaque overlays (no transparency) and overlays with the transparency specified as a bitmask, GLUT overlay management only provides access to transparent pixel overlays. </p><p>Until RGBA overlays are better understood, GLUT only supports color index overlays. </p></div></div><div class="top"><p class="src"><a name="v:overlayPossible" class="def">overlayPossible</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-Overlay.html#overlayPossible" 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> if an overlay could be established for the <em>current window</em> given the current <em>initial display mode</em>. If it contains <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:False">False</a></code>, <code>setHasOverlay</code> will fail with a fatal error if called. </p></div></div><h1 id="g:2">Showing and hiding an overlay </h1><div class="top"><p class="src"><a name="v:overlayVisible" class="def">overlayVisible</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="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a><a href="src/Graphics-UI-GLUT-Overlay.html#overlayVisible" class="link">Source</a></p><div class="doc"><p>Controls the visibility of the overlay of the <em>current window</em>. </p><p>The effect of showing or hiding an overlay takes place immediately. Note that setting <code><a href="Graphics-UI-GLUT-Overlay.html#v:overlayVisible">overlayVisible</a></code> to <code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:True">True</a></code> will not actually display the overlay unless the window is also shown (and even a shown window may be obscured by other windows, thereby obscuring the overlay). It is typically faster and less resource intensive to use the routines below to control the display status of an overlay as opposed to removing and re-establishing the overlay. </p></div></div><h1 id="g:3">Changing the <em>layer in use</em> </h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Layer" class="def">Layer</a> <a href="src/Graphics-UI-GLUT-Overlay.html#Layer" class="link">Source</a></p><div class="doc"><p>The <em>layer in use</em>. </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Normal" class="def">Normal</a></td><td class="doc"><p>The normal plane. </p></td></tr><tr><td class="src"><a name="v:Overlay" class="def">Overlay</a></td><td class="doc"><p>The overlay. </p></td></tr></table></div><div class="subs instances"><p id="control.i:Layer" class="caption collapser" onclick="toggleSection('i:Layer')">Instances</p><div id="section.i:Layer" 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-Overlay.html#t:Layer">Layer</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-Overlay.html#t:Layer">Layer</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-Overlay.html#t:Layer">Layer</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:layerInUse" class="def">layerInUse</a> :: <a href="/usr/share/doc/ghc/html/libraries/OpenGL-2.2.3.0/Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-UI-GLUT-Overlay.html#t:Layer">Layer</a><a href="src/Graphics-UI-GLUT-Overlay.html#layerInUse" class="link">Source</a></p><div class="doc"><p>Controls the per-window <em>layer in use</em> for the <em>current window</em>, which can either be the normal plane or the overlay. Selecting the overlay should only be done if an overlay exists, however windows without an overlay may still set the <em>layer in use</em> to <code><a href="Graphics-UI-GLUT-Overlay.html#v:Normal">Normal</a></code>. OpenGL commands for the window are directed to the current <em>layer in use</em>. </p></div></div><h1 id="g:4">Re-displaying </h1><div class="top"><p class="src"><a name="v:postOverlayRedisplay" class="def">postOverlayRedisplay</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-Window.html#t:Window">Window</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-Overlay.html#postOverlayRedisplay" class="link">Source</a></p><div class="doc"><p>Mark the overlay of the given window (or the <em>current window</em>, if none is supplied) as needing to be redisplayed. The next iteration through <code>Graphics.UI.GLUT.Begin.mainLoop</code>, the window's overlay display callback (or simply the display callback if no overlay display callback is registered) will be called to redisplay the window's overlay plane. Multiple calls to <code><a href="Graphics-UI-GLUT-Overlay.html#v:postOverlayRedisplay">postOverlayRedisplay</a></code> before the next display callback opportunity (or overlay display callback opportunity if one is registered) generate only a single redisplay. <code><a href="Graphics-UI-GLUT-Overlay.html#v:postOverlayRedisplay">postOverlayRedisplay</a></code> may be called within a window's display or overlay display callback to re-mark that window for redisplay. </p><p>Logically, overlay damage notification for a window is treated as a <code><a href="Graphics-UI-GLUT-Overlay.html#v:postOverlayRedisplay">postOverlayRedisplay</a></code> on the damaged window. Unlike damage reported by the window system, <code><a href="Graphics-UI-GLUT-Overlay.html#v:postOverlayRedisplay">postOverlayRedisplay</a></code> will not set to true the overlay's damaged status (see <code>Graphics.UI.GLUT.State.damaged</code>). </p><p>Also, see <code>Graphics.UI.GLUT.Window.postRedisplay</code>. </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>