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
|
<?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>glDrawRangeElements</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="glDrawPixels.3G.xml" title="glDrawPixels"/><link rel="next" href="glEdgeFlag.3G.xml" title="glEdgeFlag"/></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">glDrawRangeElements</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glDrawPixels.3G.xml">Prev</a></td><th width="60%" align="center">GL</th><td width="20%" align="right"><a accesskey="n" href="glEdgeFlag.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glDrawRangeElements.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glDrawRangeElements.3G-name"/><h2>Name</h2><p>glDrawRangeElements — render primitives from array data</p></div><div class="refsynopsisdiv"><a name="glDrawRangeElements.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void<tt>glDrawRangeElements</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum<i><tt>mode</tt></i>, GLuint<i><tt>start</tt></i>, GLuint<i><tt>end</tt></i>, GLsizei<i><tt>count</tt></i>, GLenum<i><tt>type</tt></i>, constGLvoid*<i><tt>indices</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glDrawRangeElements.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glDrawRangeElements</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>mode</tt></i>, <i><tt>start</tt></i>, <i><tt>end</tt></i>, <i><tt>count</tt></i>, <i><tt>type</tt></i>, <i><tt>indices</tt></i>) →<tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glDrawRangeElements.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>mode</tt></i></span></dt><dd>
Specifies what kind of primitives to render. Symbolic constants <tt>GL_POINTS</tt>,
<tt>GL_LINE_STRIP</tt>, <tt>GL_LINE_LOOP</tt>, <tt>GL_LINES</tt>,
<tt>GL_TRIANGLE_STRIP</tt>, <tt>GL_TRIANGLE_FAN</tt>,
<tt>GL_TRIANGLES</tt>, <tt>GL_QUAD_STRIP</tt>, <tt>GL_QUADS</tt>, and
<tt>GL_POLYGON</tt> are accepted.
</dd><dt><span class="term"><i><tt>start</tt></i></span></dt><dd>
Specifies the minimum array index contained in <i><tt>indices</tt></i>.
</dd><dt><span class="term"><i><tt>end</tt></i></span></dt><dd>
Specifies the maximum array index contained in <i><tt>indices</tt></i>.
</dd><dt><span class="term"><i><tt>count</tt></i></span></dt><dd>
Specifies the number of elements to be rendered.
</dd><dt><span class="term"><i><tt>type</tt></i></span></dt><dd>
Specifies the type of the values in <i><tt>count</tt></i>. Must be one of
<tt>GL_UNSIGNED_BYTE</tt>, <tt>GL_UNSIGNED_SHORT</tt>, or
<tt>GL_UNSIGNED_INT</tt>.
</dd><dt><span class="term"><i><tt>indices</tt></i></span></dt><dd>
Specifies a pointer to the location where the indices are stored.
</dd></dl></div></div><div class="refsect1" lang="en"><a name="glDrawRangeElements.3G-description"/><h2>Description</h2><p>
<tt>glDrawRangeElements</tt> is a restricted form of <a href="glDrawElements.3G.xml"><tt>glDrawElements</tt></a>. <i><tt>mode</tt></i>, <i><tt>start</tt></i>,
<i><tt>end</tt></i>, and <i><tt>count</tt></i> match the corresponding arguments to <a href="glDrawElements.3G.xml"><tt>glDrawElements</tt></a>, with the additional constraint that all values in the arrays
<i><tt>count</tt></i> must lie between <i><tt>start</tt></i> and <i><tt>end</tt></i>, inclusive.
</p><p>
Implementations denote recommended maximum amounts of vertex and
</p><p>
index data, which may be queried by calling <tt>glGet</tt> with argument
<tt>GL_MAX_ELEMENTS_VERTICES</tt> and <tt>GL_MAX_ELEMENTS_INDICES</tt>. If <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mrow>
<mml:mi>end</mml:mi>
<mml:mo>-</mml:mo>
<mml:mi>start</mml:mi>
<mml:mo>+</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math> is greater than the value of <tt>GL_MAX_ELEMENTS_VERTICES</tt>, or if
<i><tt>count</tt></i> is greater than the value of <tt>GL_MAX_ELEMENTS_INDICES</tt>, then the call
may operate at reduced performance. There is no requirement that all vertices in the range
[<i><tt>start</tt></i>,<i><tt>end</tt></i>] be referenced. However, the implementation may partially
process unused vertices, reducing performance from what could be achieved with an optimal index set.
</p><p>
When <tt>glDrawRangeElements</tt> is called, it uses <i><tt>start</tt></i> sequential elements from
an enabled array, starting at <i><tt>count</tt></i> to construct a sequence of geometric primitives.
<i><tt>mode</tt></i> specifies what kind of primitives are constructed, and how the array elements construct
these primitives. If more than one array is enabled, each is used. If <tt>GL_VERTEX_ARRAY</tt> is not
enabled, no geometric primitives are constructed.
</p><p>
Vertex attributes that are modified by <tt>glDrawRangeElements</tt> have an unspecified value after
<tt>glDrawRangeElements</tt> returns. For example, if <tt>GL_COLOR_ARRAY</tt> is enabled, the
value of the current color is undefined after <tt>glDrawRangeElements</tt> executes. Attributes that aren't
modified maintain their previous values.
</p></div><div class="refsect1" lang="en"><a name="glDrawRangeElements.3G-notes"/><h2>Notes</h2><p>
<tt>glDrawRangeElements</tt> is available only if the GL version is 1.2 or greater.
</p><p>
<tt>glDrawRangeElements</tt> is included in display lists. If <tt>glDrawRangeElements</tt> is
entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered
into the display list. Because the array pointers and enables are client-side state, their values affect display lists
when the lists are created, not when the lists are executed.
</p></div><div class="refsect1" lang="en"><a name="glDrawRangeElements.3G-errors"/><h2>Errors</h2><p>
It is an error for indices to lie outside the range [<i><tt>start</tt></i>,<i><tt>end</tt></i>], but
implementations may not check for this situation. Such indices cause implementation-dependent behavior.
</p><p>
<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>mode</tt></i> is not an accepted value.
</p><p>
<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>count</tt></i> is negative.
</p><p>
<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>end</tt></i> <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mo><</mml:mo>
</mml:math> <i><tt>start</tt></i>.
</p><p>
<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glDrawRangeElements</tt> is executed between
the execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
</p></div><div class="refsect1" lang="en"><a name="glDrawRangeElements.3G-associated_gets"/><h2>Associated Gets</h2><p>
<tt>glGet</tt> with argument <tt>GL_MAX_ELEMENTS_VERTICES</tt>
</p><p>
<tt>glGet</tt> with argument <tt>GL_MAX_ELEMENTS_INDICES</tt>
</p></div><div class="refsect1" lang="en"><a name="glDrawRangeElements.3G-see_also"/><h2>See Also</h2><p>
<span class="simplelist"><a href="glArrayElement.3G.xml">glArrayElement</a>, <a href="glColorPointer.3G.xml">glColorPointer</a>, <a href="glDrawArrays.3G.xml">glDrawArrays</a>, <a href="glDrawElements.3G.xml">glDrawElements</a>, <a href="glEdgeFlagPointer.3G.xml">glEdgeFlagPointer</a>, <a href="glGetPointerv.3G.xml">glGetPointerv</a>, <a href="glIndexPointer.3G.xml">glIndexPointer</a>, <a href="glInterleavedArrays.3G.xml">glInterleavedArrays</a>, <a href="glNormalPointer.3G.xml">glNormalPointer</a>, <a href="glTexCoordPointer.3G.xml">glTexCoordPointer</a>, <a href="glVertexPointer.3G.xml">glVertexPointer</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="glDrawPixels.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="glEdgeFlag.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glDrawPixels</td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top">glEdgeFlag</td></tr></table></div></body></html>
|