Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glRect"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glRect</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glRect</refname> | |
17 | <refpurpose>draw a rectangle</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glRectd</function></funcdef> | |
23 | <paramdef>GLdouble <parameter>x1</parameter></paramdef> | |
24 | <paramdef>GLdouble <parameter>y1</parameter></paramdef> | |
25 | <paramdef>GLdouble <parameter>x2</parameter></paramdef> | |
26 | <paramdef>GLdouble <parameter>y2</parameter></paramdef> | |
27 | </funcprototype> | |
28 | </funcsynopsis> | |
29 | <funcsynopsis> | |
30 | <funcprototype> | |
31 | <funcdef>void <function>glRectf</function></funcdef> | |
32 | <paramdef>GLfloat <parameter>x1</parameter></paramdef> | |
33 | <paramdef>GLfloat <parameter>y1</parameter></paramdef> | |
34 | <paramdef>GLfloat <parameter>x2</parameter></paramdef> | |
35 | <paramdef>GLfloat <parameter>y2</parameter></paramdef> | |
36 | </funcprototype> | |
37 | </funcsynopsis> | |
38 | <funcsynopsis> | |
39 | <funcprototype> | |
40 | <funcdef>void <function>glRecti</function></funcdef> | |
41 | <paramdef>GLint <parameter>x1</parameter></paramdef> | |
42 | <paramdef>GLint <parameter>y1</parameter></paramdef> | |
43 | <paramdef>GLint <parameter>x2</parameter></paramdef> | |
44 | <paramdef>GLint <parameter>y2</parameter></paramdef> | |
45 | </funcprototype> | |
46 | </funcsynopsis> | |
47 | <funcsynopsis> | |
48 | <funcprototype> | |
49 | <funcdef>void <function>glRects</function></funcdef> | |
50 | <paramdef>GLshort <parameter>x1</parameter></paramdef> | |
51 | <paramdef>GLshort <parameter>y1</parameter></paramdef> | |
52 | <paramdef>GLshort <parameter>x2</parameter></paramdef> | |
53 | <paramdef>GLshort <parameter>y2</parameter></paramdef> | |
54 | </funcprototype> | |
55 | </funcsynopsis> | |
56 | </refsynopsisdiv> | |
57 | <refsect1 id="parameters"><title>Parameters</title> | |
58 | <variablelist> | |
59 | <varlistentry> | |
60 | <term><parameter>x1</parameter></term> | |
61 | <term><parameter>y1</parameter></term> | |
62 | <listitem> | |
63 | <para> | |
64 | Specify one vertex of a rectangle. | |
65 | </para> | |
66 | </listitem> | |
67 | </varlistentry> | |
68 | <varlistentry> | |
69 | <term><parameter>x2</parameter></term> | |
70 | <term><parameter>y2</parameter></term> | |
71 | <listitem> | |
72 | <para> | |
73 | Specify the opposite vertex of the rectangle. | |
74 | </para> | |
75 | </listitem> | |
76 | </varlistentry> | |
77 | </variablelist> | |
78 | </refsect1> | |
79 | <refsynopsisdiv><title>C Specification</title> | |
80 | <funcsynopsis> | |
81 | <funcprototype> | |
82 | <funcdef>void <function>glRectdv</function></funcdef> | |
83 | <paramdef>const GLdouble * <parameter>v1</parameter></paramdef> | |
84 | <paramdef>const GLdouble * <parameter>v2</parameter></paramdef> | |
85 | </funcprototype> | |
86 | </funcsynopsis> | |
87 | <funcsynopsis> | |
88 | <funcprototype> | |
89 | <funcdef>void <function>glRectfv</function></funcdef> | |
90 | <paramdef>const GLfloat * <parameter>v1</parameter></paramdef> | |
91 | <paramdef>const GLfloat * <parameter>v2</parameter></paramdef> | |
92 | </funcprototype> | |
93 | </funcsynopsis> | |
94 | <funcsynopsis> | |
95 | <funcprototype> | |
96 | <funcdef>void <function>glRectiv</function></funcdef> | |
97 | <paramdef>const GLint * <parameter>v1</parameter></paramdef> | |
98 | <paramdef>const GLint * <parameter>v2</parameter></paramdef> | |
99 | </funcprototype> | |
100 | </funcsynopsis> | |
101 | <funcsynopsis> | |
102 | <funcprototype> | |
103 | <funcdef>void <function>glRectsv</function></funcdef> | |
104 | <paramdef>const GLshort * <parameter>v1</parameter></paramdef> | |
105 | <paramdef>const GLshort * <parameter>v2</parameter></paramdef> | |
106 | </funcprototype> | |
107 | </funcsynopsis> | |
108 | </refsynopsisdiv> | |
109 | <refsect1 id="parameters2"><title>Parameters</title> | |
110 | <variablelist> | |
111 | <varlistentry> | |
112 | <term><parameter>v1</parameter></term> | |
113 | <listitem> | |
114 | <para> | |
115 | Specifies a pointer to one vertex of a rectangle. | |
116 | </para> | |
117 | </listitem> | |
118 | </varlistentry> | |
119 | <varlistentry> | |
120 | <term><parameter>v2</parameter></term> | |
121 | <listitem> | |
122 | <para> | |
123 | Specifies a pointer to the opposite vertex of the rectangle. | |
124 | </para> | |
125 | </listitem> | |
126 | </varlistentry> | |
127 | </variablelist> | |
128 | </refsect1> | |
129 | <refsect1 id="description"><title>Description</title> | |
130 | <para> | |
131 | <function>glRect</function> supports efficient specification of rectangles as two corner points. | |
132 | Each | |
133 | rectangle command takes four arguments, | |
134 | organized either as two consecutive pairs of | |
135 | <inlineequation><mml:math> | |
136 | <!-- eqn: (x,y):--> | |
137 | <mml:mfenced open="(" close=")"> | |
138 | <mml:mi mathvariant="italic">x</mml:mi> | |
139 | <mml:mi mathvariant="italic">y</mml:mi> | |
140 | </mml:mfenced> | |
141 | </mml:math></inlineequation> | |
142 | coordinates | |
143 | or as two pointers to arrays, | |
144 | each containing an | |
145 | <inlineequation><mml:math> | |
146 | <!-- eqn: (x,y):--> | |
147 | <mml:mfenced open="(" close=")"> | |
148 | <mml:mi mathvariant="italic">x</mml:mi> | |
149 | <mml:mi mathvariant="italic">y</mml:mi> | |
150 | </mml:mfenced> | |
151 | </mml:math></inlineequation> | |
152 | pair. | |
153 | The resulting rectangle is defined in the | |
154 | <inlineequation><mml:math> | |
155 | <!-- eqn: z = 0:--> | |
156 | <mml:mrow> | |
157 | <mml:mi mathvariant="italic">z</mml:mi> | |
158 | <mml:mo>=</mml:mo> | |
159 | <mml:mn>0</mml:mn> | |
160 | </mml:mrow> | |
161 | </mml:math></inlineequation> | |
162 | plane. | |
163 | </para> | |
164 | <para> | |
165 | <function>glRect</function>(<parameter>x1</parameter>, <parameter>y1</parameter>, <parameter>x2</parameter>, <parameter>y2</parameter>) | |
166 | is exactly equivalent to the following sequence: | |
167 | <programlisting> | |
168 | glBegin(<constant>GL_POLYGON</constant>); | |
169 | glVertex2(<parameter>x1</parameter>, <parameter>y1</parameter>); | |
170 | glVertex2(<parameter>x2</parameter>, <parameter>y1</parameter>); | |
171 | glVertex2(<parameter>x2</parameter>, <parameter>y2</parameter>); | |
172 | glVertex2(<parameter>x1</parameter>, <parameter>y2</parameter>); | |
173 | glEnd(); | |
174 | </programlisting> | |
175 | Note that if the second vertex is above and to the right of the first vertex, | |
176 | the rectangle is constructed with a counterclockwise winding. | |
177 | </para> | |
178 | </refsect1> | |
179 | <refsect1 id="errors"><title>Errors</title> | |
180 | <para> | |
181 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>glRect</function> | |
182 | is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> | |
183 | and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
184 | </para> | |
185 | </refsect1> | |
186 | <refsect1 id="seealso"><title>See Also</title> | |
187 | <para> | |
188 | <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>, | |
189 | <citerefentry><refentrytitle>glVertex</refentrytitle></citerefentry> | |
190 | </para> | |
191 | </refsect1> | |
192 | <refsect1 id="Copyright"><title>Copyright</title> | |
193 | <para> | |
194 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
195 | Silicon Graphics, Inc. This document is licensed under the SGI | |
196 | Free Software B License. For details, see | |
197 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
198 | </para> | |
199 | </refsect1> | |
200 | </refentry> |