/usr/share/doc/libghc-opengl-doc/html/src/Graphics-Rendering-OpenGL-GL-FramebufferObjects-RenderbufferObjects.html is in libghc-opengl-doc 2.8.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!-- Generated by HsColour, http://code.haskell.org/~malcolm/hscolour/ -->
<title>Graphics/Rendering/OpenGL/GL/FramebufferObjects/RenderbufferObjects.hs</title>
<link type='text/css' rel='stylesheet' href='hscolour.css' />
</head>
<body>
<pre><a name="line-1"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-2"></a><span class='hs-comment'>--</span>
<a name="line-3"></a><span class='hs-comment'>-- Module : Graphics.Rendering.OpenGL.GL.FramebufferObjects.RendebufferObjects</span>
<a name="line-4"></a><span class='hs-comment'>-- Copyright :</span>
<a name="line-5"></a><span class='hs-comment'>-- License : BSD3</span>
<a name="line-6"></a><span class='hs-comment'>--</span>
<a name="line-7"></a><span class='hs-comment'>-- Maintainer : Sven Panne <sven.panne@aedion.de></span>
<a name="line-8"></a><span class='hs-comment'>-- Stability :</span>
<a name="line-9"></a><span class='hs-comment'>-- Portability :</span>
<a name="line-10"></a><span class='hs-comment'>--</span>
<a name="line-11"></a><span class='hs-comment'>-- |</span>
<a name="line-12"></a><span class='hs-comment'>--</span>
<a name="line-13"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-14"></a>
<a name="line-15"></a><span class='hs-keyword'>module</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>GL</span><span class='hs-varop'>.</span><span class='hs-conid'>FramebufferObjects</span><span class='hs-varop'>.</span><span class='hs-conid'>RenderbufferObjects</span> <span class='hs-layout'>(</span>
<a name="line-16"></a> <span class='hs-conid'>RenderbufferObject</span><span class='hs-layout'>(</span><span class='hs-conid'>RenderbufferObject</span><span class='hs-layout'>)</span><span class='hs-layout'>,</span>
<a name="line-17"></a> <span class='hs-varid'>noRenderbufferObject</span><span class='hs-layout'>,</span>
<a name="line-18"></a> <span class='hs-conid'>RenderbufferTarget</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span><span class='hs-layout'>,</span> <span class='hs-varid'>marshalRenderbufferTarget</span><span class='hs-layout'>,</span>
<a name="line-19"></a> <span class='hs-conid'>RenderbufferSize</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span><span class='hs-layout'>,</span> <span class='hs-conid'>Samples</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span><span class='hs-layout'>,</span>
<a name="line-20"></a>
<a name="line-21"></a> <span class='hs-varid'>bindRenderbuffer</span><span class='hs-layout'>,</span>
<a name="line-22"></a>
<a name="line-23"></a> <span class='hs-varid'>renderbufferStorage</span><span class='hs-layout'>,</span> <span class='hs-varid'>renderbufferStorageMultiSample</span><span class='hs-layout'>,</span>
<a name="line-24"></a>
<a name="line-25"></a> <span class='hs-varid'>getRBParameteriv</span><span class='hs-layout'>,</span>
<a name="line-26"></a><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-27"></a>
<a name="line-28"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Foreign</span><span class='hs-varop'>.</span><span class='hs-conid'>Marshal</span>
<a name="line-29"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>Raw</span><span class='hs-varop'>.</span><span class='hs-conid'>Core31</span>
<a name="line-30"></a>
<a name="line-31"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>GL</span><span class='hs-varop'>.</span><span class='hs-conid'>ObjectName</span>
<a name="line-32"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>GL</span><span class='hs-varop'>.</span><span class='hs-conid'>StateVar</span>
<a name="line-33"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>GL</span><span class='hs-varop'>.</span><span class='hs-conid'>GLboolean</span>
<a name="line-34"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>GL</span><span class='hs-varop'>.</span><span class='hs-conid'>PeekPoke</span>
<a name="line-35"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>GL</span><span class='hs-varop'>.</span><span class='hs-conid'>QueryUtils</span>
<a name="line-36"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Graphics</span><span class='hs-varop'>.</span><span class='hs-conid'>Rendering</span><span class='hs-varop'>.</span><span class='hs-conid'>OpenGL</span><span class='hs-varop'>.</span><span class='hs-conid'>GL</span><span class='hs-varop'>.</span><span class='hs-conid'>Texturing</span><span class='hs-varop'>.</span><span class='hs-conid'>PixelInternalFormat</span>
<a name="line-37"></a>
<a name="line-38"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-39"></a>
<a name="line-40"></a><a name="RenderbufferObject"></a><span class='hs-keyword'>data</span> <span class='hs-conid'>RenderbufferObject</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>RenderbufferObject</span><span class='hs-layout'>{</span> <span class='hs-varid'>rbufferID</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>GLuint</span><span class='hs-layout'>}</span>
<a name="line-41"></a>
<a name="line-42"></a><a name="instance%20ObjectName%20RenderbufferObject"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>ObjectName</span> <span class='hs-conid'>RenderbufferObject</span> <span class='hs-keyword'>where</span>
<a name="line-43"></a> <span class='hs-varid'>genObjectNames</span> <span class='hs-varid'>n</span> <span class='hs-keyglyph'>=</span>
<a name="line-44"></a> <span class='hs-varid'>allocaArray</span> <span class='hs-varid'>n</span> <span class='hs-varop'>$</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>buf</span> <span class='hs-keyglyph'>-></span> <span class='hs-keyword'>do</span>
<a name="line-45"></a> <span class='hs-varid'>glGenRenderbuffers</span> <span class='hs-layout'>(</span><span class='hs-varid'>fromIntegral</span> <span class='hs-varid'>n</span><span class='hs-layout'>)</span> <span class='hs-varid'>buf</span>
<a name="line-46"></a> <span class='hs-varid'>fmap</span> <span class='hs-layout'>(</span><span class='hs-varid'>map</span> <span class='hs-conid'>RenderbufferObject</span><span class='hs-layout'>)</span> <span class='hs-varop'>$</span> <span class='hs-varid'>peekArray</span> <span class='hs-varid'>n</span> <span class='hs-varid'>buf</span>
<a name="line-47"></a> <span class='hs-varid'>deleteObjectNames</span> <span class='hs-varid'>objs</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>withArrayLen</span> <span class='hs-layout'>(</span><span class='hs-varid'>map</span> <span class='hs-varid'>rbufferID</span> <span class='hs-varid'>objs</span><span class='hs-layout'>)</span> <span class='hs-varop'>$</span>
<a name="line-48"></a> <span class='hs-varid'>glDeleteRenderbuffers</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromIntegral</span>
<a name="line-49"></a> <span class='hs-varid'>isObjectName</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>fmap</span> <span class='hs-varid'>unmarshalGLboolean</span> <span class='hs-varop'>.</span> <span class='hs-varid'>glIsRenderbuffer</span> <span class='hs-varop'>.</span> <span class='hs-varid'>rbufferID</span>
<a name="line-50"></a>
<a name="line-51"></a><a name="noRenderbufferObject"></a><span class='hs-definition'>noRenderbufferObject</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferObject</span>
<a name="line-52"></a><span class='hs-definition'>noRenderbufferObject</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>RenderbufferObject</span> <span class='hs-num'>0</span>
<a name="line-53"></a>
<a name="line-54"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-55"></a>
<a name="line-56"></a><a name="RenderbufferTarget"></a><span class='hs-keyword'>data</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>=</span>
<a name="line-57"></a> <span class='hs-conid'>Renderbuffer</span>
<a name="line-58"></a>
<a name="line-59"></a><a name="marshalRenderbufferTarget"></a><span class='hs-definition'>marshalRenderbufferTarget</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>GLenum</span>
<a name="line-60"></a><span class='hs-definition'>marshalRenderbufferTarget</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>case</span> <span class='hs-varid'>x</span> <span class='hs-keyword'>of</span>
<a name="line-61"></a> <span class='hs-conid'>Renderbuffer</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>gl_RENDERBUFFER</span>
<a name="line-62"></a>
<a name="line-63"></a><a name="marshalRenderbufferTargetBinding"></a><span class='hs-definition'>marshalRenderbufferTargetBinding</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>PName1I</span>
<a name="line-64"></a><span class='hs-definition'>marshalRenderbufferTargetBinding</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>case</span> <span class='hs-varid'>x</span> <span class='hs-keyword'>of</span>
<a name="line-65"></a> <span class='hs-conid'>Renderbuffer</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>GetRenderbufferBinding</span>
<a name="line-66"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-67"></a>
<a name="line-68"></a><a name="RenderbufferSize"></a><span class='hs-keyword'>data</span> <span class='hs-conid'>RenderbufferSize</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>RenderbufferSize</span> <span class='hs-varop'>!</span><span class='hs-conid'>GLsizei</span> <span class='hs-varop'>!</span><span class='hs-conid'>GLsizei</span>
<a name="line-69"></a>
<a name="line-70"></a><a name="Samples"></a><span class='hs-keyword'>newtype</span> <span class='hs-conid'>Samples</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Samples</span> <span class='hs-conid'>GLsizei</span>
<a name="line-71"></a>
<a name="line-72"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-73"></a>
<a name="line-74"></a><a name="bindRenderbuffer"></a><span class='hs-definition'>bindRenderbuffer</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>StateVar</span> <span class='hs-conid'>RenderbufferObject</span>
<a name="line-75"></a><span class='hs-definition'>bindRenderbuffer</span> <span class='hs-varid'>rbt</span> <span class='hs-keyglyph'>=</span>
<a name="line-76"></a> <span class='hs-varid'>makeStateVar</span> <span class='hs-layout'>(</span><span class='hs-varid'>getBoundRenderbuffer</span> <span class='hs-varid'>rbt</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>setRenderbuffer</span> <span class='hs-varid'>rbt</span><span class='hs-layout'>)</span>
<a name="line-77"></a>
<a name="line-78"></a><a name="getBoundRenderbuffer"></a><span class='hs-definition'>getBoundRenderbuffer</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>IO</span> <span class='hs-conid'>RenderbufferObject</span>
<a name="line-79"></a><span class='hs-definition'>getBoundRenderbuffer</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>getInteger1</span> <span class='hs-layout'>(</span><span class='hs-conid'>RenderbufferObject</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromIntegral</span><span class='hs-layout'>)</span>
<a name="line-80"></a> <span class='hs-varop'>.</span> <span class='hs-varid'>marshalRenderbufferTargetBinding</span>
<a name="line-81"></a>
<a name="line-82"></a><a name="setRenderbuffer"></a><span class='hs-definition'>setRenderbuffer</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>RenderbufferObject</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
<a name="line-83"></a><span class='hs-definition'>setRenderbuffer</span> <span class='hs-varid'>rbt</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>glBindRenderbuffer</span> <span class='hs-layout'>(</span><span class='hs-varid'>marshalRenderbufferTarget</span> <span class='hs-varid'>rbt</span><span class='hs-layout'>)</span>
<a name="line-84"></a> <span class='hs-varop'>.</span> <span class='hs-varid'>rbufferID</span>
<a name="line-85"></a>
<a name="line-86"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-87"></a>
<a name="line-88"></a><a name="renderbufferStorageMultiSample"></a><span class='hs-definition'>renderbufferStorageMultiSample</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Samples</span>
<a name="line-89"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>PixelInternalFormat</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>RenderbufferSize</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
<a name="line-90"></a><span class='hs-definition'>renderbufferStorageMultiSample</span> <span class='hs-varid'>rbt</span> <span class='hs-layout'>(</span><span class='hs-conid'>Samples</span> <span class='hs-varid'>s</span><span class='hs-layout'>)</span> <span class='hs-varid'>pif</span> <span class='hs-layout'>(</span><span class='hs-conid'>RenderbufferSize</span> <span class='hs-varid'>w</span> <span class='hs-varid'>h</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span>
<a name="line-91"></a> <span class='hs-varid'>glRenderbufferStorageMultisample</span> <span class='hs-layout'>(</span><span class='hs-varid'>marshalRenderbufferTarget</span> <span class='hs-varid'>rbt</span><span class='hs-layout'>)</span> <span class='hs-varid'>s</span>
<a name="line-92"></a> <span class='hs-layout'>(</span><span class='hs-varid'>marshalPixelInternalFormat'</span> <span class='hs-varid'>pif</span><span class='hs-layout'>)</span> <span class='hs-varid'>w</span> <span class='hs-varid'>h</span>
<a name="line-93"></a>
<a name="line-94"></a>
<a name="line-95"></a><a name="renderbufferStorage"></a><span class='hs-definition'>renderbufferStorage</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>PixelInternalFormat</span>
<a name="line-96"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>RenderbufferSize</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>IO</span> <span class='hs-conid'>()</span>
<a name="line-97"></a><span class='hs-definition'>renderbufferStorage</span> <span class='hs-varid'>rbt</span> <span class='hs-varid'>pif</span> <span class='hs-layout'>(</span><span class='hs-conid'>RenderbufferSize</span> <span class='hs-varid'>w</span> <span class='hs-varid'>h</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span>
<a name="line-98"></a> <span class='hs-varid'>glRenderbufferStorage</span> <span class='hs-layout'>(</span><span class='hs-varid'>marshalRenderbufferTarget</span> <span class='hs-varid'>rbt</span><span class='hs-layout'>)</span>
<a name="line-99"></a> <span class='hs-layout'>(</span><span class='hs-varid'>marshalPixelInternalFormat'</span> <span class='hs-varid'>pif</span><span class='hs-layout'>)</span> <span class='hs-varid'>w</span> <span class='hs-varid'>h</span>
<a name="line-100"></a>
<a name="line-101"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-102"></a>
<a name="line-103"></a><a name="getRBParameteriv"></a><span class='hs-definition'>getRBParameteriv</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>RenderbufferTarget</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-conid'>GLint</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>GLenum</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>IO</span> <span class='hs-varid'>a</span>
<a name="line-104"></a><span class='hs-definition'>getRBParameteriv</span> <span class='hs-varid'>rbt</span> <span class='hs-varid'>f</span> <span class='hs-varid'>p</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>alloca</span> <span class='hs-varop'>$</span> <span class='hs-keyglyph'>\</span><span class='hs-varid'>buf</span> <span class='hs-keyglyph'>-></span> <span class='hs-keyword'>do</span>
<a name="line-105"></a> <span class='hs-varid'>glGetRenderbufferParameteriv</span> <span class='hs-layout'>(</span><span class='hs-varid'>marshalRenderbufferTarget</span> <span class='hs-varid'>rbt</span><span class='hs-layout'>)</span>
<a name="line-106"></a> <span class='hs-varid'>p</span> <span class='hs-varid'>buf</span>
<a name="line-107"></a> <span class='hs-varid'>peek1</span> <span class='hs-varid'>f</span> <span class='hs-varid'>buf</span>
</pre></body>
</html>
|