rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / xhtml / glViewportArray.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
3 <!-- saved from url=(0013)about:internet -->
4 <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glViewportArray - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glViewportArray"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glViewportArray — set multiple viewports</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glViewportArrayv</b>(</code></td><td>GLuint  </td><td><var class="pdparam">first</var>, </td></tr><tr><td> </td><td>GLsizei  </td><td><var class="pdparam">count</var>, </td></tr><tr><td> </td><td>const GLfloat * </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>first</code></em></span></dt><dd><p>
5 Specify the first viewport to set.
6 </p></dd><dt><span class="term"><em class="parameter"><code>count</code></em></span></dt><dd><p>
7 Specify the number of viewports to set.
8 </p></dd><dt><span class="term"><em class="parameter"><code>v</code></em></span></dt><dd><p>
9 Specify the address of an array containing the viewport parameters.
10 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
11 <code class="function">glViewportArrayv</code> specifies the parameters for multiple viewports
12 simulataneously. <em class="parameter"><code>first</code></em> specifies the index of the first viewport
13 to modify and <em class="parameter"><code>count</code></em> specifies the number of viewports to modify.
14 <em class="parameter"><code>first</code></em> must be less than the value of <code class="constant">GL_MAX_VIEWPORTS</code>,
15 and <em class="parameter"><code>first</code></em> + <em class="parameter"><code>count</code></em> must be less than or equal to
16 the value of <code class="constant">GL_MAX_VIEWPORTS</code>. Viewports whose indices lie outside
17 the range [<em class="parameter"><code>first</code></em>, <em class="parameter"><code>first</code></em> + <em class="parameter"><code>count</code></em>)
18 are not modified. <em class="parameter"><code>v</code></em> contains the address of an array of floating
19 point values specifying the
20 left (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>),
21 bottom (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math>),
22 width (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math>),
23 and height (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">h</mml:mi></mml:math>)
24 of each viewport, in that order. <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>
25 and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math> give
26 the location of the viewport's lower left corner, and
27 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math>
28 and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">h</mml:mi></mml:math>
29 give the width and height of the viewport, respectively.
30 The viewport specifies the affine transformation of
31 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>
32 and
33 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math>
34 from
35 normalized device coordinates to window coordinates.
36 Let
37 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
38
39 <mml:mfenced open="(" close=")">
40 <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
41 <mml:mi mathvariant="italic">nd</mml:mi>
42 </mml:msub>
43 <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
44 <mml:mi mathvariant="italic">nd</mml:mi>
45 </mml:msub>
46 </mml:mfenced>
47 </mml:math>
48 be normalized device coordinates.
49 Then the window coordinates
50 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
51
52 <mml:mfenced open="(" close=")">
53 <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
54 <mml:mi mathvariant="italic">w</mml:mi>
55 </mml:msub>
56 <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
57 <mml:mi mathvariant="italic">w</mml:mi>
58 </mml:msub>
59 </mml:mfenced>
60 </mml:math>
61 are computed as follows:
62 </p><p>
63 </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
64
65 <mml:mrow>
66 <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
67 <mml:mi mathvariant="italic">w</mml:mi>
68 </mml:msub>
69 <mml:mo>=</mml:mo>
70 <mml:mrow>
71 <mml:mfenced open="(" close=")">
72 <mml:mrow>
73 <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
74 <mml:mi mathvariant="italic">nd</mml:mi>
75 </mml:msub>
76 <mml:mo>+</mml:mo>
77 <mml:mn>1</mml:mn>
78 </mml:mrow>
79 </mml:mfenced>
80 <mml:mo></mml:mo>
81 <mml:mfenced open="(" close=")">
82 <mml:mfrac>
83 <mml:mi mathvariant="italic">width</mml:mi>
84 <mml:mn>2</mml:mn>
85 </mml:mfrac>
86 </mml:mfenced>
87 <mml:mo>+</mml:mo>
88 <mml:mi mathvariant="italic">x</mml:mi>
89 </mml:mrow>
90 </mml:mrow>
91 </mml:math></div><p>
92 </p><p>
93 </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
94
95 <mml:mrow>
96 <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
97 <mml:mi mathvariant="italic">w</mml:mi>
98 </mml:msub>
99 <mml:mo>=</mml:mo>
100 <mml:mrow>
101 <mml:mfenced open="(" close=")">
102 <mml:mrow>
103 <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
104 <mml:mi mathvariant="italic">nd</mml:mi>
105 </mml:msub>
106 <mml:mo>+</mml:mo>
107 <mml:mn>1</mml:mn>
108 </mml:mrow>
109 </mml:mfenced>
110 <mml:mo></mml:mo>
111 <mml:mfenced open="(" close=")">
112 <mml:mfrac>
113 <mml:mi mathvariant="italic">height</mml:mi>
114 <mml:mn>2</mml:mn>
115 </mml:mfrac>
116 </mml:mfenced>
117 <mml:mo>+</mml:mo>
118 <mml:mi mathvariant="italic">y</mml:mi>
119 </mml:mrow>
120 </mml:mrow>
121 </mml:math></div><p>
122 </p><p>
123 The location of the viewport's bottom left corner, given by
124 (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>, <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math>)
125 is clamped to be within the implementaiton-dependent viewport bounds range.
126 The viewport bounds range [<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">min</mml:mi></mml:math>, <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">max</mml:mi></mml:math>]
127 can be determined by calling <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument
128 <code class="constant">GL_VIEWPORT_BOUNDS_RANGE</code>.
129 Viewport width and height are silently clamped
130 to a range that depends on the implementation.
131 To query this range, call <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument
132 <code class="constant">GL_MAX_VIEWPORT_DIMS</code>.
133 </p><p>
134 The precision with which the GL interprets the floating point viewport bounds is implementation-dependent
135 and may be determined by querying the impementation-defined constant <code class="constant">GL_VIEWPORT_SUBPIXEL_BITS</code>.
136 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
137 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>first</code></em> is greater than or equal to
138 the value of <code class="constant">GL_MAX_VIEWPORTS</code>.
139 </p><p>
140 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>first</code></em> + <em class="parameter"><code>count</code></em>
141 is greater than or equal to the value of <code class="constant">GL_MAX_VIEWPORTS</code>.
142 </p><p>
143 <code class="constant">GL_INVALID_VALUE</code> is generated if either <em class="parameter"><code>width</code></em> or <em class="parameter"><code>height</code></em> is negative.
144 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
145 <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_VIEWPORT</code>
146 </p><p>
147 <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_MAX_VIEWPORT_DIMS</code>
148 </p><p>
149 <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_VIEWPORT_BOUNDS_RANGE</code>
150 </p><p>
151 <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_VIEWPORT_SUBPIXEL_BITS</code>
152 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
153 <a href="glDepthRange.xml"><span class="citerefentry"><span class="refentrytitle">glDepthRange</span></span></a>,
154 <a href="glViewport.xml"><span class="citerefentry"><span class="refentrytitle">glViewport</span></span></a>,
155 <a href="glViewportIndexed.xml"><span class="citerefentry"><span class="refentrytitle">glViewportIndexed</span></span></a>
156 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
157 Copyright <span class="trademark"></span>© 2010 Khronos Group.
158 This material may be distributed subject to the terms and conditions set forth in
159 the Open Publication License, v 1.0, 8 June 1999.
160 <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
161 </p></div></div></body></html>