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
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glLineStipple</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glLightModel.3G.xml" title="glLightModel"/><link rel="next" href="glLineWidth.3G.xml" title="glLineWidth"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glLineStipple</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glLightModel.3G.xml">Prev</a></td><th width="60%" align="center">GL</th><td width="20%" align="right"><a accesskey="n" href="glLineWidth.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glLineStipple.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glLineStipple.3G-name"/><h2>Name</h2><p>glLineStipple — specify the line stipple pattern</p></div><div class="refsynopsisdiv"><a name="glLineStipple.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void<tt>glLineStipple</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLint<i><tt>factor</tt></i>, GLushort<i><tt>pattern</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glLineStipple.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glLineStipple</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>factor</tt></i>, <i><tt>pattern</tt></i>) →<tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glLineStipple.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>factor</tt></i></span></dt><dd>
Specifies a multiplier for each bit in the line stipple pattern. If <i><tt>factor</tt></i> is 3, for
example, each bit in the pattern is used three times before the next bit in the pattern is used.
<i><tt>factor</tt></i> is clamped to the range [1, 256] and defaults to 1.
</dd><dt><span class="term"><i><tt>pattern</tt></i></span></dt><dd>
Specifies a 16-bit integer whose bit pattern determines which fragments of a line will be drawn when the
line is rasterized. Bit zero is used first; the default pattern is all 1's.
</dd></dl></div></div><div class="refsect1" lang="en"><a name="glLineStipple.3G-description"/><h2>Description</h2><p>
Line stippling masks out certain fragments produced by rasterization; those fragments will not be drawn. The masking is
achieved by using three parameters: the 16-bit line stipple pattern <i><tt>pattern</tt></i>, the repeat count
<i><tt>factor</tt></i>, and an integer stipple counter <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>s</mml:mi>
</mml:math>.
</p><p>
Counter <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>s</mml:mi>
</mml:math> is reset to 0 whenever <a href="glBegin.3G.xml"><tt>glBegin</tt></a> is called, and before each
line segment of a <a href="glBegin.3G.xml"><tt>glBegin</tt></a>(<tt>GL_LINES</tt>)/<a href="glBegin.3G.xml"><tt>glEnd</tt></a> sequence is generated. It is incremented after each fragment of a unit width
aliased line segment is generated, or after each <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>i</mml:mi>
</mml:math> fragments of an <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>i</mml:mi>
</mml:math> width line segment are generated. The <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>i</mml:mi>
</mml:math> fragments associated with count <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>s</mml:mi>
</mml:math> are masked out if <i><tt>pattern</tt></i> bit <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>/</mml:mo>
<mml:mi>factor</mml:mi>
<mml:mo>)</mml:mo>
<mml:mi>mod</mml:mi>
<mml:mn>16</mml:mn>
</mml:mrow>
</mml:math> is 0, otherwise these fragments are sent to the frame buffer. Bit zero of
<i><tt>pattern</tt></i> is the least significant bit.
</p><p>
Antialiased lines are treated as a sequence of <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo></mml:mo>
<mml:mi>width</mml:mi>
</mml:mrow>
</mml:math> rectangles for purposes of stippling. Whether rectagle <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mi>s</mml:mi>
</mml:math> is rasterized or not depends on the fragment rule described for aliased lines, counting rectangles
rather than groups of fragments.
</p><p>
To enable and disable line stippling, call <a href="glEnable.3G.xml"><tt>glEnable</tt></a> and <a href="glEnable.3G.xml"><tt>glDisable</tt></a> with argument <tt>GL_LINE_STIPPLE</tt>. When enabled, the line
stipple pattern is applied as described above. When disabled, it is as if the pattern were all 1's. Initially, line
stippling is disabled.
</p></div><div class="refsect1" lang="en"><a name="glLineStipple.3G-errors"/><h2>Errors</h2><p>
<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glLineStipple</tt> is executed between the
execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
</p></div><div class="refsect1" lang="en"><a name="glLineStipple.3G-associated_gets"/><h2>Associated Gets</h2><p>
<tt>glGet</tt> with argument <tt>GL_LINE_STIPPLE_PATTERN</tt>
</p><p>
<tt>glGet</tt> with argument <tt>GL_LINE_STIPPLE_REPEAT</tt>
</p><p>
<a href="glIsEnabled.3G.xml"><tt>glIsEnabled</tt></a> with argument <tt>GL_LINE_STIPPLE</tt>
</p></div><div class="refsect1" lang="en"><a name="glLineStipple.3G-see_also"/><h2>See Also</h2><p>
<span class="simplelist"><a href="glLineWidth.3G.xml">glLineWidth</a>, <a href="glPolygonStipple.3G.xml">glPolygonStipple</a></span>
</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glLightModel.3G.xml">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"><a accesskey="n" href="glLineWidth.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glLightModel</td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top">glLineWidth</td></tr></table></div></body></html>
|