Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?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" /><title>glScissor</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glScissor"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glScissor — define the scissor box</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">glScissor</b>(</code></td><td>GLint </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">y</var>, </td></tr><tr><td> </td><td>GLsizei </td><td><var class="pdparam">width</var>, </td></tr><tr><td> </td><td>GLsizei </td><td><var class="pdparam">height</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>x</code></em>, </span><span class="term"><em class="parameter"><code>y</code></em></span></dt><dd><p> | |
4 | Specify the lower left corner of the scissor box. | |
5 | Initially (0, 0). | |
6 | </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em>, </span><span class="term"><em class="parameter"><code>height</code></em></span></dt><dd><p> | |
7 | Specify the width and height of the scissor box. | |
8 | When a GL context is first attached to a window, | |
9 | <em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> are set to the dimensions of that | |
10 | window. | |
11 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
12 | <code class="function">glScissor</code> defines a rectangle, called the scissor box, | |
13 | in window coordinates. | |
14 | The first two arguments, | |
15 | <em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em>, | |
16 | specify the lower left corner of the box. | |
17 | <em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> specify the width and height of the box. | |
18 | </p><p> | |
19 | To enable and disable the scissor test, call | |
20 | <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument | |
21 | <code class="constant">GL_SCISSOR_TEST</code>. The test is initially disabled. | |
22 | While the test is enabled, only pixels that lie within the scissor box | |
23 | can be modified by drawing commands. | |
24 | Window coordinates have integer values at the shared corners of | |
25 | frame buffer pixels. | |
26 | <code class="code">glScissor(0,0,1,1)</code> allows modification of only the lower left | |
27 | pixel in the window, and <code class="code">glScissor(0,0,0,0)</code> doesn't allow | |
28 | modification of any pixels in the window. | |
29 | </p><p> | |
30 | When the scissor test is disabled, | |
31 | it is as though the scissor box includes the entire window. | |
32 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
33 | <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. | |
34 | </p><p> | |
35 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glScissor</code> | |
36 | is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> | |
37 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
38 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
39 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_SCISSOR_BOX</code> | |
40 | </p><p> | |
41 | <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_SCISSOR_TEST</code> | |
42 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
43 | <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>, | |
44 | <a class="citerefentry" href="glViewport.xml"><span class="citerefentry"><span class="refentrytitle">glViewport</span></span></a> | |
45 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
46 | Copyright <span class="trademark"></span>© 1991-2006 | |
47 | Silicon Graphics, Inc. This document is licensed under the SGI | |
48 | Free Software B License. For details, see | |
49 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
50 | </p></div></div></body></html> |