Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 2cca44f12eb8ef579d4d0baff7068f29 > files > 201

ghc-OpenGL-devel-2.2.3.0-7.fc15.i686.rpm

<!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.Rendering.OpenGL.GL.Framebuffer</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-Rendering-OpenGL-GL-Framebuffer.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.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">OpenGL-2.2.3.0: A binding for the OpenGL graphics system</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.Rendering.OpenGL.GL.Framebuffer</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Querying the Buffer Configuration
</a></li><li><a href="#g:2">Selecting a Buffer for Writing
</a></li><li><a href="#g:3">Fine Control of Buffer Updates
</a></li><li><a href="#g:4">Clearing the Buffers
</a></li><li><a href="#g:5">The Accumulation Buffer
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module corresponds to section 4.2 (Whole Framebuffer Operations) of the
 OpenGL 2.1 specs.
</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:auxBuffers">auxBuffers</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a></li><li class="src short"><a href="#v:doubleBuffer">doubleBuffer</a> :: <a href="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:stereoBuffer">stereoBuffer</a> :: <a href="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:rgbaBits">rgbaBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a>)</li><li class="src short"><a href="#v:stencilBits">stencilBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a></li><li class="src short"><a href="#v:depthBits">depthBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a></li><li class="src short"><a href="#v:accumBits">accumBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a>)</li><li class="src short"><a href="#v:rgbaSignedComponents">rgbaSignedComponents</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</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:BufferMode">BufferMode</a> <ul class="subs"><li>= <a href="#v:NoBuffers">NoBuffers</a>  </li><li>| <a href="#v:FrontLeftBuffer">FrontLeftBuffer</a>  </li><li>| <a href="#v:FrontRightBuffer">FrontRightBuffer</a>  </li><li>| <a href="#v:BackLeftBuffer">BackLeftBuffer</a>  </li><li>| <a href="#v:BackRightBuffer">BackRightBuffer</a>  </li><li>| <a href="#v:FrontBuffers">FrontBuffers</a>  </li><li>| <a href="#v:BackBuffers">BackBuffers</a>  </li><li>| <a href="#v:LeftBuffers">LeftBuffers</a>  </li><li>| <a href="#v:RightBuffers">RightBuffers</a>  </li><li>| <a href="#v:FrontAndBackBuffers">FrontAndBackBuffers</a>  </li><li>| <a href="#v:AuxBuffer">AuxBuffer</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a>  </li></ul></li><li class="src short"><a href="#v:drawBuffer">drawBuffer</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:BufferMode">BufferMode</a></li><li class="src short"><a href="#v:drawBuffers">drawBuffers</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> [<a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:BufferMode">BufferMode</a>]</li><li class="src short"><a href="#v:maxDrawBuffers">maxDrawBuffers</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a></li><li class="src short"><a href="#v:indexMask">indexMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLuint">GLuint</a></li><li class="src short"><a href="#v:colorMask">colorMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:Capability">Capability</a>)</li><li class="src short"><a href="#v:stencilMask">stencilMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLuint">GLuint</a></li><li class="src short"><a href="#v:stencilMaskSeparate">stencilMaskSeparate</a> :: <a href="Graphics-Rendering-OpenGL-GL-Colors.html#t:Face">Face</a> -&gt; <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:SettableStateVar">SettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLuint">GLuint</a></li><li class="src short"><a href="#v:depthMask">depthMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:Capability">Capability</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:ClearBuffer">ClearBuffer</a> <ul class="subs"><li>= <a href="#v:ColorBuffer">ColorBuffer</a>  </li><li>| <a href="#v:AccumBuffer">AccumBuffer</a>  </li><li>| <a href="#v:StencilBuffer">StencilBuffer</a>  </li><li>| <a href="#v:DepthBuffer">DepthBuffer</a>  </li></ul></li><li class="src short"><a href="#v:clear">clear</a> :: [<a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:ClearBuffer">ClearBuffer</a>] -&gt; <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"><a href="#v:clearColor">clearColor</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLclampf">GLclampf</a>)</li><li class="src short"><a href="#v:clearIndex">clearIndex</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Index1">Index1</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLfloat">GLfloat</a>)</li><li class="src short"><a href="#v:clearStencil">clearStencil</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLint">GLint</a></li><li class="src short"><a href="#v:clearDepth">clearDepth</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLclampd">GLclampd</a></li><li class="src short"><a href="#v:clearAccum">clearAccum</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLfloat">GLfloat</a>)</li><li class="src short"><span class="keyword">data</span>  <a href="#t:AccumOp">AccumOp</a> <ul class="subs"><li>= <a href="#v:Accum">Accum</a>  </li><li>| <a href="#v:Load">Load</a>  </li><li>| <a href="#v:Return">Return</a>  </li><li>| <a href="#v:Mult">Mult</a>  </li><li>| <a href="#v:Add">Add</a>  </li></ul></li><li class="src short"><a href="#v:accum">accum</a> :: <a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:AccumOp">AccumOp</a> -&gt; <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLfloat">GLfloat</a> -&gt; <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">Querying the Buffer Configuration
</h1><div class="top"><p class="src"><a name="v:auxBuffers" class="def">auxBuffers</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#auxBuffers" class="link">Source</a></p><div class="doc"><p>The implementation and context dependent number of auxiliary buffers.
</p></div></div><div class="top"><p class="src"><a name="v:doubleBuffer" class="def">doubleBuffer</a> :: <a href="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-Rendering-OpenGL-GL-Framebuffer.html#doubleBuffer" class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:True">True</a></code> if front and back buffers exist.
</p></div></div><div class="top"><p class="src"><a name="v:stereoBuffer" class="def">stereoBuffer</a> :: <a href="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-Rendering-OpenGL-GL-Framebuffer.html#stereoBuffer" class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#v:True">True</a></code> if left and right buffers exist.
</p></div></div><div class="top"><p class="src"><a name="v:rgbaBits" class="def">rgbaBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a>)<a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#rgbaBits" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:stencilBits" class="def">stencilBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#stencilBits" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:depthBits" class="def">depthBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#depthBits" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:accumBits" class="def">accumBits</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a>)<a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#accumBits" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:rgbaSignedComponents" class="def">rgbaSignedComponents</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</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-Rendering-OpenGL-GL-Framebuffer.html#rgbaSignedComponents" class="link">Source</a></p></div><h1 id="g:2">Selecting a Buffer for Writing
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:BufferMode" class="def">BufferMode</a>  <a href="src/Graphics-Rendering-OpenGL-GL-BufferMode.html#BufferMode" class="link">Source</a></p><div class="doc"><p>The set of color buffers which are selected for reading and writing.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:NoBuffers" class="def">NoBuffers</a></td><td class="doc"><p>No color buffers are selected.
</p></td></tr><tr><td class="src"><a name="v:FrontLeftBuffer" class="def">FrontLeftBuffer</a></td><td class="doc"><p>Only the front left color buffer is selected.
</p></td></tr><tr><td class="src"><a name="v:FrontRightBuffer" class="def">FrontRightBuffer</a></td><td class="doc"><p>Only the front right color buffer is selected.
</p></td></tr><tr><td class="src"><a name="v:BackLeftBuffer" class="def">BackLeftBuffer</a></td><td class="doc"><p>Only the  back left color buffer is selected.
</p></td></tr><tr><td class="src"><a name="v:BackRightBuffer" class="def">BackRightBuffer</a></td><td class="doc"><p>Only the back right color buffer is selected.
</p></td></tr><tr><td class="src"><a name="v:FrontBuffers" class="def">FrontBuffers</a></td><td class="doc"><p>Only the front left and front right color buffers are selected. If
 there is no front right color buffer, only the front left color buffer
 is selected.
</p></td></tr><tr><td class="src"><a name="v:BackBuffers" class="def">BackBuffers</a></td><td class="doc"><p>Only the back left and back right color buffers are selected. If there
 is no back right color buffer, only the back left color buffer is
 selected.
</p></td></tr><tr><td class="src"><a name="v:LeftBuffers" class="def">LeftBuffers</a></td><td class="doc"><p>Only the front left and back left color buffers are selected. If there
 is no back left color buffer, only the front left color buffer is
 selected.
</p></td></tr><tr><td class="src"><a name="v:RightBuffers" class="def">RightBuffers</a></td><td class="doc"><p>Only the front right and back right color buffers are selected. If
 there is no back right color buffer, only the front right color buffer
 is selected.
</p></td></tr><tr><td class="src"><a name="v:FrontAndBackBuffers" class="def">FrontAndBackBuffers</a></td><td class="doc"><p>All the front and back color buffers (front left, front right, back
 left, back right) are selected. If there are no back color buffers, only
 the front left and front right color buffers are selected. If there are
 no right color buffers, only the front left and back left color buffers
 are selected. If there are no right or back color buffers, only the
 front left color buffer is selected.
</p></td></tr><tr><td class="src"><a name="v:AuxBuffer" class="def">AuxBuffer</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a></td><td class="doc"><p>Only the given auxiliary color buffer no. <em>i</em> is selected.
</p></td></tr></table></div><div class="subs instances"><p id="control.i:BufferMode" class="caption collapser" onclick="toggleSection('i:BufferMode')">Instances</p><div id="section.i:BufferMode" 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-Rendering-OpenGL-GL-Framebuffer.html#t:BufferMode">BufferMode</a></td><td class="doc empty">&nbsp;</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-Rendering-OpenGL-GL-Framebuffer.html#t:BufferMode">BufferMode</a></td><td class="doc empty">&nbsp;</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-Rendering-OpenGL-GL-Framebuffer.html#t:BufferMode">BufferMode</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:drawBuffer" class="def">drawBuffer</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:BufferMode">BufferMode</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#drawBuffer" class="link">Source</a></p><div class="doc"><p>When colors are written to the framebuffer, they are written into the color
 buffers specified by <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffer">drawBuffer</a></code>.
</p><p>If more than one color buffer is selected for drawing, then blending or
 logical operations are computed and applied independently for each color
 buffer and can produce different results in each buffer.
</p><p>Monoscopic contexts include only left buffers, and stereoscopic contexts
 include both left and right buffers. Likewise, single-buffered contexts
 include only front buffers, and double-buffered contexts include both front
 and back buffers. The context is selected at GL initialization.
</p><p>The initial value is <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:FrontBuffers">FrontBuffers</a></code> for single-buffered contexts, and
 <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:BackBuffers">BackBuffers</a></code> for double-buffered contexts.
</p></div></div><div class="top"><p class="src"><a name="v:drawBuffers" class="def">drawBuffers</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> [<a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:BufferMode">BufferMode</a>]<a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#drawBuffers" class="link">Source</a></p><div class="doc"><p><code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffers">drawBuffers</a></code> defines the draw buffers to which all fragment colors are
 written. The draw buffers being defined correspond in order to the respective
 fragment colors. The draw buffer for fragment colors beyond those specified
 is set to <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:NoBuffers">NoBuffers</a></code>.
</p><p>Except for <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:NoBuffers">NoBuffers</a></code>, a buffer may not appear more then once in the given
 list. Specifying a buffer more then once will result in an
 <code>Graphics.Rendering.OpenGL.GLU.Errors.InvalidOperation</code>.
</p><p>If fixed-function fragment shading is being performed, <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffers">drawBuffers</a></code>
 specifies a set of draw buffers into which the fragment color is written.
</p><p>If a fragment shader writes to <code>gl_FragColor</code>, <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffers">drawBuffers</a></code> specifies a set
 of draw buffers into which the single fragment color defined by
 <code>gl_FragColor</code> is written. If a fragment shader writes to <code>gl_FragData</code>,
 <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffers">drawBuffers</a></code> specifies a set of draw buffers into which each of the multiple
 fragment colors defined by <code>gl_FragData</code> are separately written. If a
 fragment shader writes to neither <code>gl_FragColor</code> nor <code>gl_FragData</code>, the
 values of the fragment colors following shader execution are undefined, and
 may differ for each fragment color.
</p></div></div><div class="top"><p class="src"><a name="v:maxDrawBuffers" class="def">maxDrawBuffers</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:GettableStateVar">GettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLsizei">GLsizei</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#maxDrawBuffers" class="link">Source</a></p><div class="doc"><p>Contains the maximum number of buffers that can activated via <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffers">drawBuffers</a></code>
 or which can be simultaneously written into from within a fragment shader
 using the special output variable array <code>gl_FragData</code>. This constant
 effectively defines the size of the <code>gl_FragData</code> array. The minimum legal
 value is 1.
</p></div></div><h1 id="g:3">Fine Control of Buffer Updates
</h1><div class="top"><p class="src"><a name="v:indexMask" class="def">indexMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLuint">GLuint</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#indexMask" class="link">Source</a></p><div class="doc"><p>Controls the writing of individual bits in the color index buffers. The
 least significant <em>n</em> bits of its value, where <em>n</em> is the number of bits in a
 color index buffer, specify a mask.  Where a 1 appears in the mask, it is
 possible to write to the corresponding bit in the color index buffer (or
 buffers). Where a 0 appears, the corresponding bit is write-protected.
</p><p>This mask is used only in color index mode, and it affects only the buffers
 currently selected for writing (see <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffer">drawBuffer</a></code>). Initially, all bits are
 enabled for writing.
</p></div></div><div class="top"><p class="src"><a name="v:colorMask" class="def">colorMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:Capability">Capability</a>)<a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#colorMask" class="link">Source</a></p><div class="doc"><p>Controls whether the individual color components in the framebuffer can or
 cannot be written. If the red flag is <code>Disabled</code>, for example, no change is
 made to the red component of any pixel in any of the color buffers,
 regardless of the drawing operation attempted. Initially, all color
 components can be written.
</p><p>Changes to individual bits of components cannot be controlled. Rather,
 changes are either enabled or disabled for entire color components.
 Furthermore, this mask is used only in RGBA mode.
</p></div></div><div class="top"><p class="src"><a name="v:stencilMask" class="def">stencilMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLuint">GLuint</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#stencilMask" class="link">Source</a></p><div class="doc"><p>Controls the writing of individual bits in the stencil planes. The least
 significant <em>n</em> bits of its value, where <em>n</em> is the number of bits in the
 stencil buffer, specify a mask. Where a 1 appears in the mask, it is
 possible to write to the corresponding bit in the stencil buffer. Where a 0
 appears, the corresponding bit is write-protected.
 Initially, all bits are enabled for writing.
</p></div></div><div class="top"><p class="src"><a name="v:stencilMaskSeparate" class="def">stencilMaskSeparate</a> :: <a href="Graphics-Rendering-OpenGL-GL-Colors.html#t:Face">Face</a> -&gt; <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:SettableStateVar">SettableStateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLuint">GLuint</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#stencilMaskSeparate" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:depthMask" class="def">depthMask</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:Capability">Capability</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#depthMask" class="link">Source</a></p><div class="doc"><p>Controls whether the depth buffer is enabled for writing. The initial state
 is <code>Enabled</code>.
</p></div></div><h1 id="g:4">Clearing the Buffers
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:ClearBuffer" class="def">ClearBuffer</a>  <a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#ClearBuffer" class="link">Source</a></p><div class="doc"><p>The buffers which can be cleared with <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code>.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ColorBuffer" class="def">ColorBuffer</a></td><td class="doc"><p>The buffers currently enabled for color writing.
</p></td></tr><tr><td class="src"><a name="v:AccumBuffer" class="def">AccumBuffer</a></td><td class="doc"><p>The accumulation buffer.
</p></td></tr><tr><td class="src"><a name="v:StencilBuffer" class="def">StencilBuffer</a></td><td class="doc"><p>The stencil buffer.
</p></td></tr><tr><td class="src"><a name="v:DepthBuffer" class="def">DepthBuffer</a></td><td class="doc"><p>The depth buffer.
</p></td></tr></table></div><div class="subs instances"><p id="control.i:ClearBuffer" class="caption collapser" onclick="toggleSection('i:ClearBuffer')">Instances</p><div id="section.i:ClearBuffer" 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-Rendering-OpenGL-GL-Framebuffer.html#t:ClearBuffer">ClearBuffer</a></td><td class="doc empty">&nbsp;</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-Rendering-OpenGL-GL-Framebuffer.html#t:ClearBuffer">ClearBuffer</a></td><td class="doc empty">&nbsp;</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-Rendering-OpenGL-GL-Framebuffer.html#t:ClearBuffer">ClearBuffer</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:clear" class="def">clear</a> :: [<a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:ClearBuffer">ClearBuffer</a>] -&gt; <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-Rendering-OpenGL-GL-Framebuffer.html#clear" class="link">Source</a></p><div class="doc"><p>Set the bitplane area of the window to values previously selected by
 <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearColor">clearColor</a></code>, <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearIndex">clearIndex</a></code>, <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearDepth">clearDepth</a></code>, <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearStencil">clearStencil</a></code>, and <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearAccum">clearAccum</a></code>.
 Multiple color buffers can be cleared simultaneously by selecting more than
 one buffer at a time using <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:drawBuffer">drawBuffer</a></code>.
</p><p>The pixel ownership test, the scissor test, dithering, and the buffer
 writemasks affect the operation of <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code>. The scissor box bounds the
 cleared region. Alpha function, blend function, logical operation,
 stenciling, texure mapping, and depth-buffering are ignored by <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code>.
</p><p><code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> takes a list of buffers, indicating which buffers are to be cleared.
 If a buffer is not present, then a <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> directed at that buffer has no
 effect.
</p><p>The value to which each buffer is cleared depends on the setting of the clear
 value for that buffer.
</p></div></div><div class="top"><p class="src"><a name="v:clearColor" class="def">clearColor</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLclampf">GLclampf</a>)<a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#clearColor" class="link">Source</a></p><div class="doc"><p>Controls the red, green, blue, and alpha values used by <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> to clear
 the color buffers. Values written into <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearColor">clearColor</a></code> are clamped to the range
 [0, 1]. Initially, all values are 0.
</p></div></div><div class="top"><p class="src"><a name="v:clearIndex" class="def">clearIndex</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Index1">Index1</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLfloat">GLfloat</a>)<a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#clearIndex" class="link">Source</a></p><div class="doc"><p>Controls the index <em>c</em> used by <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> to clear the color index buffers.
 <em>c</em> is not clamped. Rather, <em>c</em> is converted to a fixed-point value with
 unspecified precision to the right of the binary point. The integer part of
 this value is then masked with 2^<em>m</em>-1, where <em>m</em> is the number of bits in a
 color index stored in the framebuffer. Initially, the value is 0.
</p></div></div><div class="top"><p class="src"><a name="v:clearStencil" class="def">clearStencil</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLint">GLint</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#clearStencil" class="link">Source</a></p><div class="doc"><p>Controls the value <em>s</em> used by <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> to clear the stencil buffer. <em>s</em> is
 masked with 2^<em>m</em>-1, where <em>m</em> is the number of bits in the stencil buffer.
 Initially, the value is 0.
</p></div></div><div class="top"><p class="src"><a name="v:clearDepth" class="def">clearDepth</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLclampd">GLclampd</a><a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#clearDepth" class="link">Source</a></p><div class="doc"><p>Controls the depth value used by <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> to clear the depth buffer. Values
 written into <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearDepth">clearDepth</a></code> are clamped to the range [0, 1]. The initial value
 is 1.
</p></div></div><div class="top"><p class="src"><a name="v:clearAccum" class="def">clearAccum</a> :: <a href="Graphics-Rendering-OpenGL-GL-StateVar.html#t:StateVar">StateVar</a> (<a href="Graphics-Rendering-OpenGL-GL-VertexSpec.html#t:Color4">Color4</a> <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLfloat">GLfloat</a>)<a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#clearAccum" class="link">Source</a></p><div class="doc"><p>Controls the red, green, blue, and alpha values used by <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> to clear
 the accumulation buffer. Values written into <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearAccum">clearAccum</a></code> are clamped to the
 range [-1, 1]. The initial values are all 0.
</p></div></div><h1 id="g:5">The Accumulation Buffer
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:AccumOp" class="def">AccumOp</a>  <a href="src/Graphics-Rendering-OpenGL-GL-Framebuffer.html#AccumOp" class="link">Source</a></p><div class="doc"><p>An operation on the accumulation buffer.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Accum" class="def">Accum</a></td><td class="doc"><p>Obtains <em>R</em>, <em>G</em>, <em>B</em>, and <em>A</em> values from the buffer currently
 selected for reading (see
 <code>Graphics.Rendering.OpenGL.GL.ReadCopyPixels.readBuffer</code>). Each
 component value is divided by 2^<em>n</em>-1, where <em>n</em> is the number of bits
 allocated to each color component in the currently selected buffer. The
 result is a floating-point value in the range [0, 1], which is
 multiplied by the value given to <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accum">accum</a></code> and added to the corresponding
 pixel component in the accumulation buffer, thereby updating the
 accumulation buffer.
</p></td></tr><tr><td class="src"><a name="v:Load" class="def">Load</a></td><td class="doc"><p>Similar to <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:Accum">Accum</a></code>, except that the current value in the accumulation
 buffer is not used in the calculation of the new value. That is, the
 <em>R</em>, <em>G</em>, <em>B</em>, and <em>A</em> values from the currently selected buffer are
 divided by 2^<em>n</em>-1, multiplied by the value given to <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accum">accum</a></code>, and then
 stored in the corresponding accumulation buffer cell, overwriting the
 current value.
</p></td></tr><tr><td class="src"><a name="v:Return" class="def">Return</a></td><td class="doc"><p>Transfers accumulation buffer values to the color buffer or buffers
 currently selected for writing. Each <em>R</em>, <em>G</em>, <em>B</em>, and <em>A</em> component
 is multiplied by the value given to <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accum">accum</a></code>, then multiplied by 2^<em>n</em>-1,
 clamped to the range [0, 2^<em>n</em>-1], and stored in the corresponding
 display buffer cell. The only fragment operations that are applied to
 this transfer are pixel ownership, scissor, dithering, and color
 writemasks.
</p></td></tr><tr><td class="src"><a name="v:Mult" class="def">Mult</a></td><td class="doc"><p>Multiplies each <em>R</em>, <em>G</em>, <em>B</em>, and <em>A</em> in the accumulation buffer by
 the value given to <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accum">accum</a></code> and returns the scaled component to its
 corresponding accumulation buffer location.
</p></td></tr><tr><td class="src"><a name="v:Add" class="def">Add</a></td><td class="doc"><p>Adds the value given to <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accum">accum</a></code> to each <em>R</em>, <em>G</em>, <em>B</em>, and <em>A</em> in the
 accumulation buffer.
</p></td></tr></table></div><div class="subs instances"><p id="control.i:AccumOp" class="caption collapser" onclick="toggleSection('i:AccumOp')">Instances</p><div id="section.i:AccumOp" 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-Rendering-OpenGL-GL-Framebuffer.html#t:AccumOp">AccumOp</a></td><td class="doc empty">&nbsp;</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-Rendering-OpenGL-GL-Framebuffer.html#t:AccumOp">AccumOp</a></td><td class="doc empty">&nbsp;</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-Rendering-OpenGL-GL-Framebuffer.html#t:AccumOp">AccumOp</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:accum" class="def">accum</a> :: <a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:AccumOp">AccumOp</a> -&gt; <a href="Graphics-Rendering-OpenGL-GL-BasicTypes.html#t:GLfloat">GLfloat</a> -&gt; <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-Rendering-OpenGL-GL-Framebuffer.html#accum" class="link">Source</a></p><div class="doc"><p>The accumulation buffer is an extended-range color buffer. Images are not
 rendered into it. Rather, images rendered into one of the color buffers are
 added to the contents of the accumulation buffer after rendering. Effects
 such as antialiasing (of points, lines, and polygons), motion blur, and
 depth of field can be created by accumulating images generated with different
 transformation matrices.
</p><p>Each pixel in the accumulation buffer consists of red, green, blue, and alpha
 values. The number of bits per component in the accumulation buffer depends
 on the implementation (see <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accumBits">accumBits</a></code>). Regardless of the number of bits per
 component, the range of values stored by each component is [-1, 1]. The
 accumulation buffer pixels are mapped one-to-one with frame buffer pixels.
</p><p><code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accum">accum</a></code> operates on the accumulation buffer. The first argument selects an
 accumulation buffer operation. The second argument, is a floating-point value
 to be used in that operation, see <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#t:AccumOp">AccumOp</a></code>.
</p><p>All accumulation buffer operations are limited to the area of the current
 scissor box and applied identically to the red, green, blue, and alpha
 components of each pixel. If an <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:accum">accum</a></code> operation results in a value outside
 the range [-1, 1], the contents of an accumulation buffer pixel component
 are undefined.
</p><p>To clear the accumulation buffer, use <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clearAccum">clearAccum</a></code> to specify the clear
 value, then call <code><a href="Graphics-Rendering-OpenGL-GL-Framebuffer.html#v:clear">clear</a></code> with the accumulation buffer enabled.
</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>