Branch: Tag:

2002-03-12

2002-03-12 03:24:54 by Martin Nilsson <mani@lysator.liu.se>

More explicit moves

Rev: refdoc/structure/traditional.xml:1.11

1: + <!doctype html><html><head><title>Pike Reference Manual</title> + <meta charset='utf-8'></head> + <body><dl><dt><h1 class='header'>9. 3D Vector Graphics</h1></dt><dd><dl><dt><h2 class='header'>Module <b class='ms datatype'>GL</b></h2> + </dt><dd><dl class='group--doc'> + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Not implemented methods:</p> + <p><table class='box'> + <tr><td>glAreTexturesResident</td></tr> + <tr><td>glBitmap</td></tr> + <tr><td>glBlendColorEXT</td></tr> + <tr><td>glCallLists</td></tr> + <tr><td>glColorPointer</td></tr> + <tr><td>glDeleteTextures</td></tr> + <tr><td>glDrawElements</td></tr> + <tr><td>glEdgeFlagPointer</td></tr> + <tr><td>glEdgeFlagv</td></tr> + <tr><td>glEvalMesh</td></tr> + <tr><td>glFeedbackBuffer</td></tr> + <tr><td>glGenTextures</td></tr> + <tr><td>glGetBooleanv</td></tr> + <tr><td>glGetClipPlane</td></tr> + <tr><td>glGetDoublev</td></tr> + <tr><td>glGetFloatv</td></tr> + <tr><td>glGetIntegerv</td></tr> + <tr><td>glGetLightfv</td></tr> + <tr><td>glGetLightiv</td></tr> + <tr><td>glGetMapdv</td></tr> + <tr><td>glGetMapfv</td></tr> + <tr><td>glGetMapiv</td></tr> + <tr><td>glGetMaterialfv</td></tr> + <tr><td>glGetMaterialiv</td></tr> + <tr><td>glGetPixelMapfv</td></tr> + <tr><td>glGetPixelMapuiv</td></tr> + <tr><td>glGetPixelMapusv</td></tr> + <tr><td>glGetPointerv</td></tr> + <tr><td>glGetPolygonStipple</td></tr> + <tr><td>glGetTexEnvfv</td></tr> + <tr><td>glGetTexEnviv</td></tr> + <tr><td>glGetTexGendv</td></tr> + <tr><td>glGetTexGenfv</td></tr> + <tr><td>glGetTexGeniv</td></tr> + <tr><td>glGetTexImage</td></tr> + <tr><td>glGetTexLevelParameterfv</td></tr> + <tr><td>glGetTexLevelParameteriv</td></tr> + <tr><td>glGetTexParameterfv</td></tr> + <tr><td>glGetTexParameteriv</td></tr> + <tr><td>glIndexPointer</td></tr> + <tr><td>glInterleavedArrays</td></tr> + <tr><td>glMap1</td></tr> + <tr><td>glMap2</td></tr> + <tr><td>glMapGrid</td></tr> + <tr><td>glNormalPointer</td></tr> + <tr><td>glPixelMapfv</td></tr> + <tr><td>glPixelMapuiv</td></tr> + <tr><td>glPixelMapusv</td></tr> + <tr><td>glPixelStore</td></tr> + <tr><td>glPixelTransfer</td></tr> + <tr><td>glPolygonStipple</td></tr> + <tr><td>glPrioritizeTextures</td></tr> + <tr><td>glReadPixels</td></tr> + <tr><td>glRect</td></tr> + <tr><td>glSelectBuffer</td></tr> + <tr><td>glTexCoordPointer</td></tr> + <tr><td>glTexImage1D</td></tr> + <tr><td>glTexSubImage1D</td></tr> + <tr><td>glVertexPointer</td></tr> + </table> + </p> + </dd></dl>    -  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glAccum</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glAccum</span>(</b><code class='datatype'>int</code> <code class='argument'>op</code>, <code class='datatype'>float</code> <code class='argument'>value</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The accumulation buffer is an extended-range color buffer. + Images are not rendered into it. + Rather, + images rendered into one of the color buffers + are added to the contents of the accumulation buffer after rendering. + Effects such as antialiasing (of points, lines, and polygons), + motion blur, + and depth of field can be created + by accumulating images generated with different transformation matrices.</p> + <p>Each pixel in the accumulation buffer consists of + red, green, blue, and alpha values. + The number of bits per component in the accumulation buffer + depends on the implementation. You can examine this number + by calling <code>glGetIntegerv</code> four times, + with arguments <code>GL_ACCUM_RED_BITS</code>, + <code>GL_ACCUM_GREEN_BITS</code>, + <code>GL_ACCUM_BLUE_BITS</code>, + and <code>GL_ACCUM_ALPHA_BITS</code>. + Regardless of the number of bits per component, + the range of values stored by each component is [-1, 1]. + The accumulation buffer pixels are mapped one-to-one with frame buffer pixels.</p> + <p><code>glAccum</code> operates on the accumulation buffer. + The first argument, <i>op</i>, + is a symbolic constant that selects an accumulation buffer operation. + The second argument, <i>value</i>, + is a floating-point value to be used in that operation. + Five operations are specified: + <code>GL_ACCUM</code>, <code>GL_LOAD</code>, <code>GL_ADD</code>, + <code>GL_MULT</code>, and <code>GL_RETURN</code>.</p> + <p>All accumulation buffer operations are limited + to the area of the current scissor box and applied identically to + the red, green, blue, and alpha components of each pixel. + If a <code>glAccum</code> operation results in a value outside the range [-1, 1], + the contents of an accumulation buffer pixel component are undefined.</p> + <p>The operations are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_ACCUM</code> + </td><td>Obtains R, G, B, and A values + from the buffer currently selected for reading (see <code>glReadBuffer</code>). + Each component value is divided by 2n1, + where n is the number of bits allocated to each color component + in the currently selected buffer. + The result is a floating-point value in the range [0, 1], + which is multiplied by <i>value</i> and added to the corresponding pixel component + in the accumulation buffer, + thereby updating the accumulation buffer. + </td></tr> + <tr><td><code>GL_LOAD</code> + </td><td>Similar to <code>GL_ACCUM</code>, + except that the current value in the accumulation buffer is not used + in the calculation of the new value. + That is, the R, G, B, and A values from the currently selected buffer + are divided by 2n1, + multiplied by <i>value</i>, + and then stored in the corresponding accumulation buffer cell, + overwriting the current value. + </td></tr> + <tr><td><code>GL_ADD</code> + </td><td>Adds <i>value</i> to each R, G, B, and A + in the accumulation buffer. + </td></tr> + <tr><td><code>GL_MULT</code> + </td><td>Multiplies each R, G, B, and A + in the accumulation buffer by <i>value</i> and returns the scaled component + to its corresponding accumulation buffer location. + </td></tr> + <tr><td><code>GL_RETURN</code> + </td><td>Transfers accumulation buffer values + to the color buffer or buffers currently selected for writing. + Each R, G, B, and A component is multiplied by <i>value</i>, + then multiplied by 2n1, + clamped to the range [0, 2n1 ], and stored + in the corresponding display buffer cell. + The only fragment operations that are applied to this transfer are + pixel ownership, + scissor, + dithering, + and color writemasks. + </td></tr> + </table> + </p> + <p>To clear the accumulation buffer, call <code>glClearAccum</code> with R, G, B, + and A values to set it to, then call <code>glClear</code> with the + accumulation buffer enabled.</p> + </dd> + <dt class='head--doc'><span id='p-op'></span>Parameter <code class='parameter'>op</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the accumulation buffer operation. + Symbolic constants + <code>GL_ACCUM</code>, + <code>GL_LOAD</code>, + <code>GL_ADD</code>, + <code>GL_MULT</code>, + and + <code>GL_RETURN</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-value'></span>Parameter <code class='parameter'>value</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a floating-point value used in the accumulation buffer operation. + <i>op</i> determines how <i>value</i> is used.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>op</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if there is no accumulation buffer.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glAccum</code> + is executed between the execution of + <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glAlphaFunc</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glAlphaFunc</span>(</b><code class='datatype'>int</code> <code class='argument'>func</code>, <code class='datatype'>float</code> <code class='argument'>ref</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The alpha test discards fragments depending on the outcome of a comparison + between an incoming fragment's alpha value and a constant reference value. + <code>glAlphaFunc</code> specifies the reference value and the comparison function. + The comparison is performed only if alpha testing is enabled. By + default, it is not enabled. + (See + <code>glEnable</code> and <code>glDisable</code> of <code>GL_ALPHA_TEST</code>.)</p> + <p><i>func</i> and <i>ref</i> specify the conditions under which + the pixel is drawn. + The incoming alpha value is compared to <i>ref</i> + using the function specified by <i>func</i>. + If the value passes the comparison, + the incoming fragment is drawn + if it also passes subsequent stencil and depth buffer tests. + If the value fails the comparison, + no change is made to the frame buffer at that pixel location. The + comparison functions are as follows: </p> + <p><table class='box'> + <tr><td><code>GL_NEVER</code> + </td><td>Never passes. + </td></tr> + <tr><td><code>GL_LESS</code> + </td><td>Passes if the incoming alpha value is less than the reference value. + </td></tr> + <tr><td><code>GL_EQUAL</code> + </td><td>Passes if the incoming alpha value is equal to the reference value. + </td></tr> + <tr><td><code>GL_LEQUAL</code> + </td><td>Passes if the incoming alpha value is less than or equal to the reference value. + </td></tr> + <tr><td><code>GL_GREATER</code> + </td><td>Passes if the incoming alpha value is greater than the reference value. + </td></tr> + <tr><td><code>GL_NOTEQUAL</code> + </td><td>Passes if the incoming alpha value is not equal to the reference value. + </td></tr> + <tr><td><code>GL_GEQUAL</code> + </td><td>Passes if the incoming alpha value is greater than or equal to + the reference value. + </td></tr> + <tr><td><code>GL_ALWAYS</code> + </td><td>Always passes (initial value). + </td></tr> + </table> + </p> + <p><code>glAlphaFunc</code> operates on all pixel write operations, + including those resulting from the scan conversion of points, + lines, + polygons, + and bitmaps, + and from pixel draw and copy operations. + <code>glAlphaFunc</code> does not affect screen clear operations.</p> + </dd> + <dt class='head--doc'><span id='p-func'></span>Parameter <code class='parameter'>func</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the alpha comparison function. + Symbolic constants + <code>GL_NEVER</code>, + <code>GL_LESS</code>, + <code>GL_EQUAL</code>, + <code>GL_LEQUAL</code>, + <code>GL_GREATER</code>, + <code>GL_NOTEQUAL</code>, + <code>GL_GEQUAL</code>, and + <code>GL_ALWAYS</code> are accepted. The initial value is <code>GL_ALWAYS</code>.</p> + </dd> + <dt class='head--doc'><span id='p-ref'></span>Parameter <code class='parameter'>ref</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the reference value that incoming alpha values are compared to. + This value is clamped to the range 0 through 1, + where 0 represents the lowest possible alpha value + and 1 the highest possible value. + The initial reference value + is 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>func</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glAlphaFunc</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glArrayElement</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glArrayElement</span>(</b><code class='datatype'>int</code> <code class='argument'>i</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glArrayElement</code> commands are used within <code>glBegin</code>/<code>glEnd</code> pairs to + specify vertex and attribute data for point, line, and polygon + primitives. If <code>GL_VERTEX_ARRAY</code> is enabled when <code>glArrayElement</code> is called, a + single vertex is drawn, using + vertex and attribute data taken from location <i>i</i> of the enabled + arrays. If <code>GL_VERTEX_ARRAY</code> is not enabled, no drawing occurs but + the attributes corresponding to the enabled arrays are modified. </p> + <p>Use <code>glArrayElement</code> to construct primitives by indexing vertex data, rather than + by streaming through arrays of data in first-to-last order. Because + each call specifies only a single vertex, it is possible to explicitly + specify per-primitive attributes such as a single normal per + individual triangle.</p> + <p>Changes made to array data between the execution of <code>glBegin</code> and the + corresponding execution of <code>glEnd</code> may affect calls to <code>glArrayElement</code> that are made + within the same <code>glBegin</code>/<code>glEnd</code> period in non-sequential ways. + That is, a call to </p> + <p><code>glArrayElement</code> that precedes a change to array data may + access the changed data, and a call that follows a change to array data + may access original data.</p> + </dd> + <dt class='head--doc'><span id='p-i'></span>Parameter <code class='parameter'>i</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies an index into the enabled vertex data arrays.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glBegin</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glBegin</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glBegin</code> and <code>glEnd</code> delimit the vertices that define a primitive or + a group of like primitives. + <code>glBegin</code> accepts a single argument that specifies in which of ten ways the + vertices are interpreted. + Taking <i>n</i> as an integer count starting at one, + and <i>N</i> as the total number of vertices specified, + the interpretations are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_POINTS</code> + </td><td>Treats each vertex as a single point. + Vertex <i>n</i> defines point <i>n</i>. + <i>N</i> points are drawn. + </td></tr> + <tr><td><code>GL_LINES</code> + </td><td>Treats each pair of vertices as an independent line segment. + Vertices <i>2n-1</i> and <i>2n</i> define line <i>n</i>. + <i>N/2</i> lines are drawn. + </td></tr> + <tr><td><code>GL_LINE_STRIP</code> + </td><td>Draws a connected group of line segments from the first vertex + to the last. + Vertices <i>n</i> and <i>n+1</i> define line <i>n</i>. + <i>N-1</i> lines are drawn. + </td></tr> + <tr><td><code>GL_LINE_LOOP</code> + </td><td>Draws a connected group of line segments from the first vertex + to the last, + then back to the first. + Vertices <i>n</i> and <i>n+1</i> define line <i>n</i>. + The last line, however, is defined by vertices <i>N</i> and <i>1</i>. + <i>N</i> lines are drawn. + </td></tr> + <tr><td><code>GL_TRIANGLES</code> + </td><td>Treats each triplet of vertices as an independent triangle. + Vertices <i>3n-2</i>, + <i>3n-1</i>, + and <i>3n</i> define triangle <i>n</i>. + <i>N/3</i> triangles are drawn. + </td></tr> + <tr><td><code>GL_TRIANGLE_STRIP</code> + </td><td>Draws a connected group of triangles. + One triangle is defined for each vertex presented after the first two vertices. + For odd <i>n</i>, vertices <i>n</i>, + <i>n+1</i>, + and <i>n+2</i> define triangle <i>n</i>. + For even <i>n</i>, + vertices <i>n+1</i>, + <i>n</i>, + and <i>n+2</i> define triangle <i>n</i>. + <i>N-2</i> triangles are drawn. + </td></tr> + <tr><td><code>GL_TRIANGLE_FAN</code> + </td><td>Draws a connected group of triangles. + One triangle is defined for each vertex presented after the first two vertices. + Vertices <i>1</i>, + <i>n+1</i>, + and <i>n+2</i> define triangle <i>n</i>. + <i>N-2</i> triangles are drawn. + </td></tr> + <tr><td><code>GL_QUADS</code> + </td><td>Treats each group of four vertices as an independent quadrilateral. + Vertices <i>4n-3</i>, + <i>4n-2</i>, + <i>4n-1</i>, + and <i>4n</i> define quadrilateral <i>n</i>. + <i>N/4</i> quadrilaterals are drawn. + </td></tr> + <tr><td><code>GL_QUAD_STRIP</code> + </td><td>Draws a connected group of quadrilaterals. + One quadrilateral is defined for each pair of vertices presented + after the first pair. + Vertices <i>2n-1</i>, + <i>2n</i>, + <i>2n+2</i>, + and <i>2n+1</i> define quadrilateral <i>n</i>. + <i>N/2-1</i> quadrilaterals are drawn. + Note that the order in which vertices are used to construct a quadrilateral + from strip data is different from that used with independent data. + </td></tr> + <tr><td><code>GL_POLYGON</code> + </td><td>Draws a single, + convex polygon. + Vertices <i>1</i> through <i>N</i> define this polygon. + </td></tr> + </table> + </p> + <p>Only a subset of GL commands can be used between <code>glBegin</code> and <code>glEnd</code>. + The commands are + <code>glVertex</code>, + <code>glColor</code>, + <code>glIndex</code>, + <code>glNormal</code>, + <code>glTexCoord</code>, + <code>glEvalCoord</code>, + <code>glEvalPoint</code>, + <code>glArrayElement</code>, + <code>glMaterial</code>, and + <code>glEdgeFlag</code>. + Also, + it is acceptable to use + <code>glCallList</code> or + <code>glCallLists</code> to execute + display lists that include only the preceding commands. + If any other GL command is executed between <code>glBegin</code> and <code>glEnd</code>, + the error flag is set and the command is ignored.</p> + <p>Regardless of the value chosen for <i>mode</i>, + there is no limit to the number of vertices that can be defined + between <code>glBegin</code> and <code>glEnd</code>. + Lines, + triangles, + quadrilaterals, + and polygons that are incompletely specified are not drawn. + Incomplete specification results when either too few vertices are + provided to specify even a single primitive or when an incorrect multiple + of vertices is specified. The incomplete primitive is ignored; the rest are drawn.</p> + <p>The minimum specification of vertices + for each primitive is as follows: + 1 for a point, + 2 for a line, + 3 for a triangle, + 4 for a quadrilateral, + and 3 for a polygon. + Modes that require a certain multiple of vertices are + <code>GL_LINES</code> (2), + <code>GL_TRIANGLES</code> (3), + <code>GL_QUADS</code> (4), + and <code>GL_QUAD_STRIP</code> (2).</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the primitive or primitives that will be created from vertices + presented between <code>glBegin</code> and the subsequent <code>glEnd</code>. + Ten symbolic constants are accepted: + <code>GL_POINTS</code>, + <code>GL_LINES</code>, + <code>GL_LINE_STRIP</code>, + <code>GL_LINE_LOOP</code>, + <code>GL_TRIANGLES</code>, + <code>GL_TRIANGLE_STRIP</code>, + <code>GL_TRIANGLE_FAN</code>, + <code>GL_QUADS</code>, + <code>GL_QUAD_STRIP</code>, and + <code>GL_POLYGON</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is set to an unaccepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glBegin</code> is executed between a + <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEnd</code> is executed without being + preceded by a <code>glBegin</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if a command other than + <code>glVertex</code>, + <code>glColor</code>, + <code>glIndex</code>, + <code>glNormal</code>, + <code>glTexCoord</code>, + <code>glEvalCoord</code>, + <code>glEvalPoint</code>, + <code>glArrayElement</code>, + <code>glMaterial</code>, + <code>glEdgeFlag</code>, + <code>glCallList</code>, or + <code>glCallLists</code> is executed between + the execution of <code>glBegin</code> and the corresponding + execution <code>glEnd</code>.</p> + <p>Execution of + <code>glEnableClientState</code>, + <code>glDisableClientState</code>, + <code>glEdgeFlagPointer</code>, + <code>glTexCoordPointer</code>, + <code>glColorPointer</code>, + <code>glIndexPointer</code>, + <code>glNormalPointer</code>,</p> + <p><code>glVertexPointer</code>, + <code>glInterleavedArrays</code>, or + <code>glPixelStore</code> is not allowed after a call to <code>glBegin</code> and before + the corresponding call to <code>glEnd</code>, + but an error may or may not be generated.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glBindTexture</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glBindTexture</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>texture</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glBindTexture</code> lets you create or use a named texture. Calling <code>glBindTexture</code> with </p> + <p><i>target</i> set to + <code>GL_TEXTURE_1D</code> or <code>GL_TEXTURE_2D</code> and <i>texture</i> set to the name + of the newtexture binds the texture name to the target. + When a texture is bound to a target, the previous binding for that + target is automatically broken.</p> + <p>Texture names are unsigned integers. The value zero is reserved to + represent the default texture for each texture target. + Texture names and the corresponding texture contents are local to + the shared display-list space (see <code>glXCreateContext</code>) of the current + GL rendering context; + two rendering contexts share texture names only if they + also share display lists.</p> + <p>You may use <code>glGenTextures</code> to generate a set of new texture names.</p> + <p>When a texture is first bound, it assumes the dimensionality of its + target: A texture first bound to <code>GL_TEXTURE_1D</code> becomes + 1-dimensional and a texture first bound to <code>GL_TEXTURE_2D</code> becomes + 2-dimensional. The state of a 1-dimensional texture + immediately after it is first bound is equivalent to the state of the + default <code>GL_TEXTURE_1D</code> at GL initialization, and similarly for + 2-dimensional textures.</p> + <p>While a texture is bound, GL operations on the target to which it is + bound affect the bound texture, and queries of the target to which it + is bound return state from the bound texture. If texture mapping of + the dimensionality of the target to which a texture is bound is + active, the bound texture is used. + In effect, the texture targets become aliases for the textures currently + bound to them, and the texture name zero refers to the default textures + that were bound to them at initialization.</p> + <p>A texture binding created with <code>glBindTexture</code> remains active until a different + texture is bound to the same target, or until the bound texture is + deleted with <code>glDeleteTextures</code>.</p> + <p>Once created, a named texture may be re-bound to the target of the + matching dimensionality as often as needed. + It is usually much faster to use <code>glBindTexture</code> to bind an existing named + texture to one of the texture targets than it is to reload the texture image + using <code>glTexImage1D</code> or <code>glTexImage2D</code>. + For additional control over performance, use + <code>glPrioritizeTextures</code>.</p> + <p><code>glBindTexture</code> is included in display lists.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target to which the texture is bound. + Must be either + <code>GL_TEXTURE_1D</code> or + <code>GL_TEXTURE_2D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-texture'></span>Parameter <code class='parameter'>texture</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the name of a texture.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not one of the allowable + values.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <i>texture</i> has a dimensionality + which doesn't match that of <i>target</i>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glBindTexture</code> is executed + between the execution of <code>glBegin</code> and the corresponding + execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glBlendFunc</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glBlendFunc</span>(</b><code class='datatype'>int</code> <code class='argument'>sfactor</code>, <code class='datatype'>int</code> <code class='argument'>dfactor</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>In RGBA mode, pixels can be drawn using a function that blends + the incoming (source) RGBA values with the RGBA values + that are already in the frame buffer (the destination values). + Blending is initially disabled. + Use <code>glEnable</code> and <code>glDisable</code> with argument <code>GL_BLEND</code> + to enable and disable blending.</p> + <p><code>glBlendFunc</code> defines the operation of blending when it is enabled. + <i>sfactor</i> specifies which of nine methods is used to scale the + source color components. + <i>dfactor</i> specifies which of eight methods is used to scale the + destination color components. + The eleven possible methods are described in the following table. + Each method defines four scale factors, + one each for red, green, blue, and alpha.</p> + <p>In the table and in subsequent equations, source and destination + color components are referred to as + (R sub s , G sub s , B sub s , A sub s ) and + (R sub d , G sub d , B sub d , A sub d ). + They are understood to have integer values between 0 and + (k sub R , k sub G , k sub B , k sub A ), + where</p> + <p>.RS + .ce + k sub c ~=~ 2 sup m sub c - 1 + .RE</p> + <p>and + (m sub R , m sub G , m sub B , m sub A ) + is the number of red, + green, + blue, + and alpha bitplanes.</p> + <p>Source and destination scale factors are referred to as + (s sub R , s sub G , s sub B , s sub A ) and + (d sub R , d sub G , d sub B , d sub A ). + The scale factors described in the table, + denoted (f sub R , f sub G , f sub B , f sub A ), + represent either source or destination factors. + All scale factors have range [0,1].</p> + <p>.TS + center box ; + ci | ci + c | c . + parameter (f sub R , ~~ f sub G , ~~ f sub B , ~~ f sub A ) + = + <code>GL_ZERO</code> (0, ~0, ~0, ~0 ) + <code>GL_ONE</code> (1, ~1, ~1, ~1 ) + <code>GL_SRC_COLOR</code> (R sub s / k sub R , ~G sub s / k sub G , ~B sub s / k sub B , ~A sub s / k sub A ) + <code>GL_ONE_MINUS_SRC_COLOR</code> (1, ~1, ~1, ~1 ) ~-~ (R sub s / k sub R , ~G sub s / k sub G , ~B sub s / k sub B , ~A sub s / k sub A ) + <code>GL_DST_COLOR</code> (R sub d / k sub R , ~G sub d / k sub G , ~B sub d / k sub B , ~A sub d / k sub A ) + <code>GL_ONE_MINUS_DST_COLOR</code> (1, ~1, ~1, ~1 ) ~-~ (R sub d / k sub R , ~G sub d / k sub G , ~B sub d / k sub B , ~A sub d / k sub A ) + <code>GL_SRC_ALPHA</code> (A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A ) + <code>GL_ONE_MINUS_SRC_ALPHA</code> (1, ~1, ~1, ~1 ) ~-~ (A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A , ~A sub s / k sub A ) + <code>GL_DST_ALPHA</code> (A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A ) + <code>GL_ONE_MINUS_DST_ALPHA</code> (1, ~1, ~1, ~1 ) ~-~ (A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A , ~A sub d / k sub A ) + <code>GL_SRC_ALPHA_SATURATE</code> (i, ~i, ~i, ~1 ) + .TE + .sp + In the table,</p> + <p>.RS + .nf</p> + <p>i ~=~ min (A sub s , ~k sub A - A sub d ) ~/~ k sub A + .fi + .RE</p> + <p>To determine the blended RGBA values of a pixel when drawing in RGBA mode, + the system uses the following equations:</p> + <p>.RS + .nf</p> + <p>R sub d ~=~ min ( k sub R , ~~ R sub s s sub R + R sub d d sub R ) + G sub d ~=~ min ( k sub G , ~~ G sub s s sub G + G sub d d sub G ) + B sub d ~=~ min ( k sub B , ~~ B sub s s sub B + B sub d d sub B ) + A sub d ~=~ min ( k sub A , ~~ A sub s s sub A + A sub d d sub A ) + .fi + .RE</p> + <p>Despite the apparent precision of the above equations, + blending arithmetic is not exactly specified, + because blending operates with imprecise integer color values. + However, + a blend factor that should be equal to 1 + is guaranteed not to modify its multiplicand, + and a blend factor equal to 0 reduces its multiplicand to 0. + For example, + when <i>sfactor</i> is <code>GL_SRC_ALPHA</code>, + <i>dfactor</i> is <code>GL_ONE_MINUS_SRC_ALPHA</code>, + and A sub s is equal to k sub A, + the equations reduce to simple replacement:</p> + <p>.RS + .nf</p> + <p>R sub d ~=~ R sub s + G sub d ~=~ G sub s + B sub d ~=~ B sub s + A sub d ~=~ A sub s + .fi + .RE</p> + </dd> + <dt class='head--doc'><span id='p-sfactor'></span>Parameter <code class='parameter'>sfactor</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies how the red, green, blue, + and alpha source blending factors are computed. + Nine symbolic constants are accepted: + <code>GL_ZERO</code>, + <code>GL_ONE</code>, + <code>GL_DST_COLOR</code>, + <code>GL_ONE_MINUS_DST_COLOR</code>, + <code>GL_SRC_ALPHA</code>, + <code>GL_ONE_MINUS_SRC_ALPHA</code>, + <code>GL_DST_ALPHA</code>, + <code>GL_ONE_MINUS_DST_ALPHA</code>, and + <code>GL_SRC_ALPHA_SATURATE</code>. The initial value is <code>GL_ONE</code>.</p> + </dd> + <dt class='head--doc'><span id='p-dfactor'></span>Parameter <code class='parameter'>dfactor</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies how the red, green, blue, + and alpha destination blending factors are computed. + Eight symbolic constants are accepted: + <code>GL_ZERO</code>, + <code>GL_ONE</code>, + <code>GL_SRC_COLOR</code>, + <code>GL_ONE_MINUS_SRC_COLOR</code>, + <code>GL_SRC_ALPHA</code>, + <code>GL_ONE_MINUS_SRC_ALPHA</code>, + <code>GL_DST_ALPHA</code>, and + <code>GL_ONE_MINUS_DST_ALPHA</code>. The initial value is <code>GL_ZERO</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if either <i>sfactor</i> or <i>dfactor</i> is not an + accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glBlendFunc</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glCallList</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCallList</span>(</b><code class='datatype'>int</code> <code class='argument'>list</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCallList</code> causes the named display list to be executed. + The commands saved in the display list are executed in order, + just as if they were called without using a display list. + If <i>list</i> has not been defined as a display list, + <code>glCallList</code> is ignored.</p> + <p><code>glCallList</code> can appear inside a display list. + To avoid the possibility of infinite recursion resulting from display lists + calling one another, + a limit is placed on the nesting level of display + lists during display-list execution. + This limit is at least 64, and it depends on the implementation.</p> + <p>GL state is not saved and restored across a call to <code>glCallList</code>. + Thus, + changes made to GL state during the execution of a display list + remain after execution of the display list is completed. + Use <code>glPushAttrib</code>, + <code>glPopAttrib</code>, + <code>glPushMatrix</code>, + and <code>glPopMatrix</code> to preserve GL state across <code>glCallList</code> calls.</p> + </dd> + <dt class='head--doc'><span id='p-list'></span>Parameter <code class='parameter'>list</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the integer name of the display list to be executed.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glClear</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClear</span>(</b><code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glClear</code> sets the bitplane area of the window to values previously selected + by <code>glClearColor</code>, <code>glClearIndex</code>, <code>glClearDepth</code>, + <code>glClearStencil</code>, and <code>glClearAccum</code>. + Multiple color buffers can be cleared simultaneously by selecting + more than one buffer at a time using <code>glDrawBuffer</code>.</p> + <p>The pixel ownership test, + the scissor test, + dithering, and the buffer writemasks affect the operation of <code>glClear</code>. + The scissor box bounds the cleared region. + Alpha function, + blend function, + logical operation, + stenciling, + texture mapping, + and depth-buffering are ignored by <code>glClear</code>.</p> + <p><code>glClear</code> takes a single argument that is the bitwise OR of several + values indicating which buffer is to be cleared.</p> + <p>The values are as follows: </p> + <p><table class='box'> + <tr><td><code>GL_COLOR_BUFFER_BIT</code> + </td><td>Indicates the buffers currently enabled for color + writing. + </td></tr> + <tr><td><code>GL_DEPTH_BUFFER_BIT</code> + </td><td>Indicates the depth buffer. + </td></tr> + <tr><td><code>GL_ACCUM_BUFFER_BIT</code> + </td><td>Indicates the accumulation buffer. + </td></tr> + <tr><td><code>GL_STENCIL_BUFFER_BIT</code> + </td><td>Indicates the stencil buffer. + </td></tr> + </table> + </p> + <p>The value to which each buffer is cleared depends on the setting of the + clear value for that buffer.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Bitwise OR of masks that indicate the buffers to be cleared. + The four masks are + <code>GL_COLOR_BUFFER_BIT</code>, + <code>GL_DEPTH_BUFFER_BIT</code>, + <code>GL_ACCUM_BUFFER_BIT</code>, and + <code>GL_STENCIL_BUFFER_BIT</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if any bit other than the four defined + bits is set in <i>mask</i>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glClear</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glClearAccum</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearAccum</span>(</b><code class='datatype'>float</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>) <code class='argument'>red</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>green</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>blue</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glClearAccum</code> specifies the red, green, blue, and alpha values used by <code>glClear</code> + to clear the accumulation buffer.</p> + <p>Values specified by <code>glClearAccum</code> are clamped to the + range [-1,1].</p> + </dd> + <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the red, green, blue, and alpha values used when the + accumulation buffer is cleared. + The initial values are all 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearAccum</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glClearColor</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearColor</span>(</b><code class='datatype'>float</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>) <code class='argument'>red</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>green</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>blue</code>, <code class='datatype'>float</code>|<code class='datatype'>void</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glClearColor</code> specifies the red, + green, + blue, + and alpha values used by <code>glClear</code> to clear the color buffers. + Values specified by <code>glClearColor</code> are clamped to the range [0,1].</p> + </dd> + <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the red, green, blue, and alpha values used when the + color buffers are cleared. + The initial values are all 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearColor</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glClearDepth</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearDepth</span>(</b><code class='datatype'>float</code> <code class='argument'>depth</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glClearDepth</code> specifies the depth value used by <code>glClear</code> to clear the depth buffer. + Values specified by <code>glClearDepth</code> are clamped to the range [0,1].</p> + </dd> + <dt class='head--doc'><span id='p-depth'></span>Parameter <code class='parameter'>depth</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the depth value used when the depth buffer is cleared. The + initial value is 1.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearDepth</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glClearIndex</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearIndex</span>(</b><code class='datatype'>float</code> <code class='argument'>c</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glClearIndex</code> specifies the index used by <code>glClear</code> + to clear the color index buffers. + <i>c</i> is not clamped. + Rather, + <i>c</i> is converted to a fixed-point value with unspecified precision + to the right of the binary point. + The integer part of this value is then masked with 2 sup m -1, + where m is the number of bits in a color index stored in the frame buffer.</p> + </dd> + <dt class='head--doc'><span id='p-c'></span>Parameter <code class='parameter'>c</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the index used when the color index buffers are cleared. + The initial value is 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearIndex</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glClearStencil</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glClearStencil</span>(</b><code class='datatype'>int</code> <code class='argument'>s</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glClearStencil</code> specifies the index used by <code>glClear</code> to clear the stencil buffer. + <i>s</i> is masked with 2 sup m - 1, + where m is the number of bits in the stencil buffer.</p> + </dd> + <dt class='head--doc'><span id='p-s'></span>Parameter <code class='parameter'>s</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the index used when the stencil buffer is cleared. + The initial value is 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glClearStencil</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glColor</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glColor</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>red</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>green</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>blue</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The GL stores both a current single-valued color index + and a current four-valued RGBA color. + <code>glColor</code> sets a new four-valued RGBA color. + <code>glColor</code> has two major variants: + <code>glColor3</code> and <code>glColor4</code>. + <code>glColor3</code> variants specify new red, + green, + and blue values explicitly + and set the current alpha value to 1.0 (full intensity) implicitly. + <code>glColor4</code> variants specify all four color components explicitly.</p> + <p><code>glColor3b</code>, <code>glColor4b</code>, + <code>glColor3s</code>, <code>glColor4s</code>, <code>glColor3i</code>, and <code>glColor4i</code> take + three or four signed byte, short, or long integers as arguments. + When <code>v</code> is appended to the name, + the color commands can take a pointer to an array of such values.</p> + <p>Current color values are stored in floating-point format, + with unspecified mantissa and exponent sizes. + Unsigned integer color components, + when specified, + are linearly mapped to floating-point values such that the largest + representable value maps to 1.0 (full intensity), + and 0 maps to 0.0 (zero intensity). + Signed integer color components, + when specified, + are linearly mapped to floating-point values such that the most positive + representable value maps to 1.0, + and the most negative representable value maps to -1.0. (Note that + this mapping does not convert 0 precisely to 0.0.) + Floating-point values are mapped directly.</p> + <p>Neither floating-point nor signed integer values are clamped + to the range [0,1] before the current color is updated. + However, + color components are clamped to this range before they are interpolated + or written into a color buffer.</p> + </dd> + <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> + <dd></dd><dd class='body--doc'><p>Specify new red, green, and blue values for the current color.</p> + </dd> + <dt class='head--doc'><span id='p-alpha'></span>Parameter <code class='parameter'>alpha</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a new alpha value for the current color. + Included only in the four-argument <code>glColor4</code> commands.</p> + </dd> + <dt class='head--doc'><span id='p-v'></span>Parameter <code class='parameter'>v</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array that contains red, green, blue, + and (sometimes) alpha values.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glColorMask</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glColorMask</span>(</b><code class='datatype'>int</code> <code class='argument'>red</code>, <code class='datatype'>int</code> <code class='argument'>green</code>, <code class='datatype'>int</code> <code class='argument'>blue</code>, <code class='datatype'>int</code> <code class='argument'>alpha</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glColorMask</code> specifies whether the individual color components in the frame buffer + can or cannot be written. + If <i>red</i> is <code>GL_FALSE</code>, + for example, + no change is made to the red component of any pixel in any of the + color buffers, + regardless of the drawing operation attempted.</p> + <p>Changes to individual bits of components cannot be controlled. + Rather, + changes are either enabled or disabled for entire color components.</p> + </dd> + <dt class='head--doc'><span id='p-red'></span>Parameter <code class='parameter'>red</code></dt> + <dd></dd><dd class='body--doc'><p>Specify whether red, green, blue, and alpha can or cannot be written + into the frame buffer. + The initial values are all <code>GL_TRUE</code>, + indicating that the color components can be written.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glColorMask</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glColorMaterial</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glColorMaterial</span>(</b><code class='datatype'>int</code> <code class='argument'>face</code>, <code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glColorMaterial</code> specifies which material parameters track the current color. + When <code>GL_COLOR_MATERIAL</code> is enabled, + the material parameter or parameters specified by <i>mode</i>, + of the material or materials specified by <i>face</i>, + track the current color at all times.</p> + <p>To enable and disable <code>GL_COLOR_MATERIAL</code>, call + <code>glEnable</code> and <code>glDisable</code> with argument <code>GL_COLOR_MATERIAL</code>. + <code>GL_COLOR_MATERIAL</code> is initially disabled.</p> + </dd> + <dt class='head--doc'><span id='p-face'></span>Parameter <code class='parameter'>face</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies whether front, + back, + or both front and back material parameters should track the current color. + Accepted values are + <code>GL_FRONT</code>, + <code>GL_BACK</code>, + and <code>GL_FRONT_AND_BACK</code>. + The initial value is <code>GL_FRONT_AND_BACK</code>.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies which of several material parameters track the current color. + Accepted values are + <code>GL_EMISSION</code>, + <code>GL_AMBIENT</code>, + <code>GL_DIFFUSE</code>, + <code>GL_SPECULAR</code>, + and <code>GL_AMBIENT_AND_DIFFUSE</code>. + The initial value is <code>GL_AMBIENT_AND_DIFFUSE</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>face</i> or <i>mode</i> is not an + accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glColorMaterial</code> is executed between + the execution of <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glCopyPixels</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyPixels</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code>, <code class='datatype'>int</code> <code class='argument'>type</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCopyPixels</code> copies a screen-aligned rectangle of pixels + from the specified frame buffer location to a region relative to the + current raster position. + Its operation is well defined only if the entire pixel source region + is within the exposed portion of the window. + Results of copies from outside the window, + or from regions of the window that are not exposed, + are hardware dependent and undefined.</p> + <p><i>x</i> and <i>y</i> specify the window coordinates of + the lower left corner of the rectangular region to be copied. + <i>width</i> and <i>height</i> specify the dimensions of the + rectangular region to be copied. + Both <i>width</i> and <i>height</i> must not be negative.</p> + <p>Several parameters control the processing of the pixel data + while it is being copied. + These parameters are set with three commands: + <code>glPixelTransfer</code>, + <code>glPixelMap</code>, and + <code>glPixelZoom</code>. + This reference page describes the effects on <code>glCopyPixels</code> of most, + but not all, of the parameters specified by these three commands.</p> + <p><code>glCopyPixels</code> copies values from each pixel with the lower left-hand corner at + (<i>x</i> + i, <i>y</i> + j) for 0\(&lt;=i&lt;<i>width</i> and 0\(&lt;=j&lt;<i>height</i>. + This pixel is said to be the ith pixel in the jth row. + Pixels are copied in row order from the lowest to the highest row, + left to right in each row.</p> + <p><i>type</i> specifies whether color, depth, or stencil data is to be copied. + The details of the transfer for each data type are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_COLOR</code> + </td><td>Indices or RGBA colors are read from the buffer currently specified as the + read source buffer (see <code>glReadBuffer</code>). + If the GL is in color index mode, + each index that is read from this buffer is converted + to a fixed-point format with an unspecified + number of bits to the right of the binary point. + Each index is then shifted left by <code>GL_INDEX_SHIFT</code> bits, + and added to <code>GL_INDEX_OFFSET</code>. + If <code>GL_INDEX_SHIFT</code> is negative, + the shift is to the right. + In either case, zero bits fill otherwise unspecified bit locations in the + result. + If <code>GL_MAP_COLOR</code> is true, + the index is replaced with the value that it references in lookup table + <code>GL_PIXEL_MAP_I_TO_I</code>. + Whether the lookup replacement of the index is done or not, + the integer part of the index is then ANDed with 2 sup b -1, + where b is the number of bits in a color index buffer. +  + If the GL is in RGBA mode, + the red, green, blue, and alpha components of each pixel that is read + are converted to an internal floating-point format with unspecified + precision. + The conversion maps the largest representable component value to 1.0, + and component value 0 to 0.0. + The resulting floating-point color values are then multiplied + by <code>GL_c_SCALE</code> and added to <code>GL_c_BIAS</code>, + where <i>c</i> is RED, GREEN, BLUE, and ALPHA + for the respective color components. + The results are clamped to the range [0,1]. + If <code>GL_MAP_COLOR</code> is true, + each color component is scaled by the size of lookup table + <code>GL_PIXEL_MAP_c_TO_c</code>, + then replaced by the value that it references in that table. + <i>c</i> is R, G, B, or A. +  + The GL then converts the resulting indices or RGBA colors to fragments + by attaching the current raster position <i>z</i> coordinate and + texture coordinates to each pixel, + then assigning window coordinates + (x sub r + i , y sub r + j), + where (x sub r , y sub r) is the current raster position, + and the pixel was the ith pixel in the jth row. + These pixel fragments are then treated just like the fragments generated by + rasterizing points, lines, or polygons. + Texture mapping, + fog, + and all the fragment operations are applied before the fragments are written + to the frame buffer. + </td></tr> + <tr><td><code>GL_DEPTH</code> + </td><td>Depth values are read from the depth buffer and + converted directly to an internal floating-point format + with unspecified precision. + The resulting floating-point depth value is then multiplied + by <code>GL_DEPTH_SCALE</code> and added to <code>GL_DEPTH_BIAS</code>. + The result is clamped to the range [0,1]. +  + The GL then converts the resulting depth components to fragments + by attaching the current raster position color or color index and + texture coordinates to each pixel, + then assigning window coordinates + (x sub r + i , y sub r + j), + where (x sub r , y sub r) is the current raster position, + and the pixel was the ith pixel in the jth row. + These pixel fragments are then treated just like the fragments generated by + rasterizing points, lines, or polygons. + Texture mapping, + fog, + and all the fragment operations are applied before the fragments are written + to the frame buffer. + </td></tr> + <tr><td><code>GL_STENCIL</code> + </td><td>Stencil indices are read from the stencil buffer and + converted to an internal fixed-point format + with an unspecified number of bits to the right of the binary point. + Each fixed-point index is then shifted left by <code>GL_INDEX_SHIFT</code> bits, + and added to <code>GL_INDEX_OFFSET</code>. + If <code>GL_INDEX_SHIFT</code> is negative, + the shift is to the right. + In either case, zero bits fill otherwise unspecified bit locations in the + result. + If <code>GL_MAP_STENCIL</code> is true, + the index is replaced with the value that it references in lookup table + <code>GL_PIXEL_MAP_S_TO_S</code>. + Whether the lookup replacement of the index is done or not, + the integer part of the index is then ANDed with 2 sup b -1, + where b is the number of bits in the stencil buffer. + The resulting stencil indices are then written to the stencil buffer + such that the index read from the ith location of the jth row + is written to location + (x sub r + i , y sub r + j), + where (x sub r , y sub r) is the current raster position. + Only the pixel ownership test, + the scissor test, + and the stencil writemask affect these write operations. + </td></tr> + </table> + </p> + <p>The rasterization described thus far assumes pixel zoom factors of 1.0. + If </p> + <p><code>glPixelZoom</code> is used to change the x and y pixel zoom factors, + pixels are converted to fragments as follows. + If (x sub r, y sub r) is the current raster position, + and a given pixel is in the ith location in the jth row of the source + pixel rectangle, + then fragments are generated for pixels whose centers are in the rectangle + with corners at</p> + <p>.ce + (x sub r + zoom sub x i, y sub r + zoom sub y j) + .sp .5 + .ce +  and + .sp .5 + .ce + (x sub r + zoom sub x (i + 1), y sub r + zoom sub y ( j + 1 ))</p> + <p>where zoom sub x is the value of <code>GL_ZOOM_X</code> and + zoom sub y is the value of <code>GL_ZOOM_Y</code>.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the dimensions of the rectangular region of pixels to be copied. + Both must be nonnegative.</p> + </dd> + <dt class='head--doc'><span id='p-type'></span>Parameter <code class='parameter'>type</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies whether color values, + depth values, + or stencil values are to be copied. + Symbolic constants + <code>GL_COLOR</code>, + <code>GL_DEPTH</code>, + and <code>GL_STENCIL</code> are accepted.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is not an accepted value.</p> + <p><code>GL_INVALID_VALUE</code> is generated if either <i>width</i> or <i>height</i> is negative.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <i>type</i> is <code>GL_DEPTH</code> + and there is no depth buffer.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <i>type</i> is <code>GL_STENCIL</code> + and there is no stencil buffer.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyPixels</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glCopyTexImage1D</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexImage1D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>internalFormat</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>border</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCopyTexImage1D</code> defines a one-dimensional texture image with pixels from the current + <code>GL_READ_BUFFER</code>.</p> + <p>The screen-aligned pixel row with left corner at ("x", "y") + and with a length of "width"~+~2~*~"border" + defines the texture array + at the mipmap level specified by <i>level</i>. + <i>internalFormat</i> specifies the internal format of the texture array.</p> + <p>The pixels in the row are processed exactly as if + <code>glCopyPixels</code> had been called, but the process stops just before + final conversion. + At this point all pixel component values are clamped to the range [0,\ 1] + and then converted to the texture's internal format for storage in the texel + array.</p> + <p>Pixel ordering is such that lower x screen coordinates correspond to + lower texture coordinates.</p> + <p>If any of the pixels within the specified row of the current + <code>GL_READ_BUFFER</code> are outside the window associated with the current + rendering context, then the values obtained for those pixels are undefined.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture. + Must be <code>GL_TEXTURE_1D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. + Level 0 is the base image level. + Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + </dd> + <dt class='head--doc'><span id='p-internalFormat'></span>Parameter <code class='parameter'>internalFormat</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the internal format of the texture. + Must be one of the following symbolic constants: + <code>GL_ALPHA</code>, + <code>GL_ALPHA4</code>, + <code>GL_ALPHA8</code>, + <code>GL_ALPHA12</code>, + <code>GL_ALPHA16</code>, + <code>GL_LUMINANCE</code>, + <code>GL_LUMINANCE4</code>, + <code>GL_LUMINANCE8</code>, + <code>GL_LUMINANCE12</code>, + <code>GL_LUMINANCE16</code>, + <code>GL_LUMINANCE_ALPHA</code>, + <code>GL_LUMINANCE4_ALPHA4</code>, + <code>GL_LUMINANCE6_ALPHA2</code>, + <code>GL_LUMINANCE8_ALPHA8</code>, + <code>GL_LUMINANCE12_ALPHA4</code>, + <code>GL_LUMINANCE12_ALPHA12</code>, + <code>GL_LUMINANCE16_ALPHA16</code>, + <code>GL_INTENSITY</code>, + <code>GL_INTENSITY4</code>, + <code>GL_INTENSITY8</code>, + <code>GL_INTENSITY12</code>, + <code>GL_INTENSITY16</code>, + <code>GL_RGB</code>, + <code>GL_R3_G3_B2</code>, + <code>GL_RGB4</code>, + <code>GL_RGB5</code>, + <code>GL_RGB8</code>, + <code>GL_RGB10</code>, + <code>GL_RGB12</code>, + <code>GL_RGB16</code>, + <code>GL_RGBA</code>, + <code>GL_RGBA2</code>, + <code>GL_RGBA4</code>, + <code>GL_RGB5_A1</code>, + <code>GL_RGBA8</code>, + <code>GL_RGB10_A2</code>, + <code>GL_RGBA12</code>, or + <code>GL_RGBA16</code>.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the left corner + of the row of pixels to be copied.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the texture image. + Must be 0 or 2**n ~+~ 2*<i>border</i> for some integer n. + The height of the texture image is 1.</p> + </dd> + <dt class='head--doc'><span id='p-border'></span>Parameter <code class='parameter'>border</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the border. + Must be either 0 or 1.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not one of the + allowable values.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. + .P + <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater + than log sub 2 max, + where max is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>. + .P + <code>GL_INVALID_VALUE</code> is generated if <i>internalFormat</i> is not an + allowable value. </p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>width</i> is less than 0 + or greater than + 2 + <code>GL_MAX_TEXTURE_SIZE</code>, + or if it cannot be represented as 2 ** n ~+~ 2~*~("border") + for some integer value of <i>n</i>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>border</i> is not 0 or 1.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyTexImage1D</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glCopyTexImage2D</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexImage2D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>internalFormat</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code>, <code class='datatype'>int</code> <code class='argument'>border</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCopyTexImage2D</code> defines a two-dimensional texture image with pixels from the current + <code>GL_READ_BUFFER</code>.</p> + <p>The screen-aligned pixel rectangle with lower left corner at (<i>x</i>, + <i>y</i>) and with a width of <i>width</i>~+~2~*~<i>border</i> and a height of + <i>height</i>~+~2~*~<i>border</i> + defines the texture array + at the mipmap level specified by <i>level</i>. + <i>internalFormat</i> specifies the internal format of the texture array.</p> + <p>The pixels in the rectangle are processed exactly as if + <code>glCopyPixels</code> had been called, but the process stops just before + final conversion. + At this point all pixel component values are clamped to the range [0,1] + and then converted to the texture's internal format for storage in the texel + array.</p> + <p>Pixel ordering is such that lower x and y screen coordinates correspond to + lower s and t texture coordinates.</p> + <p>If any of the pixels within the specified rectangle of the current + <code>GL_READ_BUFFER</code> are outside the window associated with the current + rendering context, then the values obtained for those pixels are undefined.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture. + Must be <code>GL_TEXTURE_2D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. + Level 0 is the base image level. + Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + </dd> + <dt class='head--doc'><span id='p-internalFormat'></span>Parameter <code class='parameter'>internalFormat</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the internal format of the texture. + Must be one of the following symbolic constants: + <code>GL_ALPHA</code>, + <code>GL_ALPHA4</code>, + <code>GL_ALPHA8</code>, + <code>GL_ALPHA12</code>, + <code>GL_ALPHA16</code>, + <code>GL_LUMINANCE</code>, + <code>GL_LUMINANCE4</code>, + <code>GL_LUMINANCE8</code>, + <code>GL_LUMINANCE12</code>, + <code>GL_LUMINANCE16</code>, + <code>GL_LUMINANCE_ALPHA</code>, + <code>GL_LUMINANCE4_ALPHA4</code>, + <code>GL_LUMINANCE6_ALPHA2</code>, + <code>GL_LUMINANCE8_ALPHA8</code>, + <code>GL_LUMINANCE12_ALPHA4</code>, + <code>GL_LUMINANCE12_ALPHA12</code>, + <code>GL_LUMINANCE16_ALPHA16</code>, + <code>GL_INTENSITY</code>, + <code>GL_INTENSITY4</code>, + <code>GL_INTENSITY8</code>, + <code>GL_INTENSITY12</code>, + <code>GL_INTENSITY16</code>, + <code>GL_RGB</code>, + <code>GL_R3_G3_B2</code>, + <code>GL_RGB4</code>, + <code>GL_RGB5</code>, + <code>GL_RGB8</code>, + <code>GL_RGB10</code>, + <code>GL_RGB12</code>, + <code>GL_RGB16</code>, + <code>GL_RGBA</code>, + <code>GL_RGBA2</code>, + <code>GL_RGBA4</code>, + <code>GL_RGB5_A1</code>, + <code>GL_RGBA8</code>, + <code>GL_RGB10_A2</code>, + <code>GL_RGBA12</code>, or + <code>GL_RGBA16</code>.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the texture image. + Must be 0 or 2**n ~+~ 2*<i>border</i> for some integer n.</p> + </dd> + <dt class='head--doc'><span id='p-height'></span>Parameter <code class='parameter'>height</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the height of the texture image. + Must be 0 or 2**m ~+~ 2*<i>border</i> for some integer m.</p> + </dd> + <dt class='head--doc'><span id='p-border'></span>Parameter <code class='parameter'>border</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the border. + Must be either 0 or 1.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_2D</code>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. + .P + <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater + than log sub 2 max, + where max is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>width</i> or <i>height</i> is less than 0, + greater than 2~+~<code>GL_MAX_TEXTURE_SIZE</code>, or if <i>width</i> or <i>height</i> cannot be + represented as 2**k ~+~ 2~*~<i>border</i> for some integer + k.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>border</i> is not 0 or 1.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>internalFormat</i> is not one of the + allowable values.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyTexImage2D</code> is executed + between the execution of <code>glBegin</code> and the corresponding + execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glCopyTexSubImage1D</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexSubImage1D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>xoffset</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCopyTexSubImage1D</code> replaces a portion of a one-dimensional + texture image with pixels from the current <code>GL_READ_BUFFER</code> (rather + than from main memory, as is the case for <code>glTexSubImage1D</code>).</p> + <p>The screen-aligned pixel row with left corner at (<i>x</i>,\ <i>y</i>), and with + length <i>width</i> replaces the portion of the + texture array with x indices <i>xoffset</i> through "xoffset" ~+~ "width" ~-~ 1, + inclusive. The destination in the texture array may not + include any texels outside the texture array as it was + originally specified.</p> + <p>The pixels in the row are processed exactly as if + <code>glCopyPixels</code> had been called, but the process stops just before + final conversion. + At this point all pixel component values are clamped to the range [0,\ 1] + and then converted to the texture's internal format for storage in the texel + array.</p> + <p>It is not an error to specify a subtexture with zero width, but + such a specification has no effect. + If any of the pixels within the specified row of the current + <code>GL_READ_BUFFER</code> are outside the read window associated with the current + rendering context, then the values obtained for those pixels are undefined.</p> + <p>No change is made to the <i>internalformat</i>, <i>width</i>, + or <i>border</i> parameters of the specified texture + array or to texel values outside the specified subregion.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture. + Must be <code>GL_TEXTURE_1D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. + Level 0 is the base image level. + Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + </dd> + <dt class='head--doc'><span id='p-xoffset'></span>Parameter <code class='parameter'>xoffset</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the texel offset within the texture array.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the left corner + of the row of pixels to be copied.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the texture subimage.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_1D</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if the texture array has not + been defined by a previous <code>glTexImage1D</code> or <code>glCopyTexImage1D</code> operation.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. + .P + <code>GL_INVALID_VALUE</code> may be generated if <i>level</i>&gt;log sub 2<i> max</i>, + where <i>max</i> is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>y</i> ~&lt;~ ~-b + or if <i>width</i> ~&lt;~ ~-b, where b + is the border width of the texture array.</p> + <p><code>GL_INVALID_VALUE</code> is generated if "xoffset" ~&lt;~ ~-b, or + ("xoffset"~+~"width") ~&gt;~ (w-b), + where w is the <code>GL_TEXTURE_WIDTH</code>, and b is the <code>GL_TEXTURE_BORDER</code> + of the texture image being modified. + Note that w includes twice the border width.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glCopyTexSubImage2D</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCopyTexSubImage2D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>xoffset</code>, <code class='datatype'>int</code> <code class='argument'>yoffset</code>, <code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCopyTexSubImage2D</code> replaces a rectangular portion of a two-dimensional + texture image with pixels from the current <code>GL_READ_BUFFER</code> (rather + than from main memory, as is the case for <code>glTexSubImage2D</code>).</p> + <p>The screen-aligned pixel rectangle with lower left corner at + (<i>x</i>,\ <i>y</i>) and with + width <i>width</i> and height <i>height</i> replaces the portion of the + texture array with x indices <i>xoffset</i> through <i>xoffset</i>~+~<i>width</i>~-~1, + inclusive, and y indices <i>yoffset</i> through <i>yoffset</i>~+~<i>height</i>~-~1, + inclusive, at the mipmap level specified by <i>level</i>.</p> + <p>The pixels in the rectangle are processed exactly as if + <code>glCopyPixels</code> had been called, but the process stops just before + final conversion. + At this point, all pixel component values are clamped to the range [0,\ 1] + and then converted to the texture's internal format for storage in the texel + array.</p> + <p>The destination rectangle in the texture array may not include any texels + outside the texture array as it was originally specified. + It is not an error to specify a subtexture with zero width or height, but + such a specification has no effect.</p> + <p>If any of the pixels within the specified rectangle of the current + <code>GL_READ_BUFFER</code> are outside the read window associated with the current + rendering context, then the values obtained for those pixels are undefined.</p> + <p>No change is made to the <i>internalformat</i>, <i>width</i>, + <i>height</i>, or <i>border</i> parameters of the specified texture + array or to texel values outside the specified subregion.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture. + Must be <code>GL_TEXTURE_2D</code></p> + </dd> + <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. + Level 0 is the base image level. + Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + </dd> + <dt class='head--doc'><span id='p-xoffset'></span>Parameter <code class='parameter'>xoffset</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texel offset in the x direction within the texture array.</p> + </dd> + <dt class='head--doc'><span id='p-yoffset'></span>Parameter <code class='parameter'>yoffset</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texel offset in the y direction within the texture array.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the window coordinates of the lower left corner + of the rectangular region of pixels to be copied.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the texture subimage.</p> + </dd> + <dt class='head--doc'><span id='p-height'></span>Parameter <code class='parameter'>height</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the height of the texture subimage.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_2D</code>. </p> + <p><code>GL_INVALID_OPERATION</code> is generated if the texture array has not + been defined by a previous <code>glTexImage2D</code> or <code>glCopyTexImage2D</code> operation.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. + .P + <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater + than log sub 2 max, + where max is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>x</i> ~&lt;~ ~-b or if + <i>y</i> ~&lt;~ ~-b, + where b is the border width of the texture array.</p> + <p><code>GL_INVALID_VALUE</code> is generated if "xoffset" ~&lt;~ -b, + (<i>xoffset</i>~+~<i>width</i>)~&gt;~(w ~-~b), + <i>yoffset</i>~&lt;~ ~-b, or + (<i>yoffset</i>~+~<i>height</i>)~&gt;~(h ~-~b), + where w is the <code>GL_TEXTURE_WIDTH</code>, + h is the <code>GL_TEXTURE_HEIGHT</code>, + and b is the <code>GL_TEXTURE_BORDER</code> + of the texture image being modified. + Note that w and h + include twice the border width.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCopyTexSubImage2D</code> is executed + between the execution of <code>glBegin</code> and the corresponding + execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glCullFace</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glCullFace</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCullFace</code> specifies whether front- or back-facing facets are culled + (as specified by <i>mode</i>) when facet culling is enabled. Facet + culling is initially disabled. + To enable and disable facet culling, call the + <code>glEnable</code> and <code>glDisable</code> commands + with the argument <code>GL_CULL_FACE</code>. + Facets include triangles, + quadrilaterals, + polygons, + and rectangles.</p> + <p><code>glFrontFace</code> specifies which of the clockwise and counterclockwise facets + are front-facing and back-facing. + See <code>glFrontFace</code>.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies whether front- or back-facing facets are candidates for culling. + Symbolic constants + <code>GL_FRONT</code>, <code>GL_BACK</code>, and <code>GL_FRONT_AND_BACK</code> are accepted. + The initial value is <code>GL_BACK</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glCullFace</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDeleteLists</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDeleteLists</span>(</b><code class='datatype'>int</code> <code class='argument'>list</code>, <code class='datatype'>int</code> <code class='argument'>range</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glDeleteLists</code> causes a contiguous group of display lists to be deleted. + <i>list</i> is the name of the first display list to be deleted, + and <i>range</i> is the number of display lists to delete. + All display lists \fId\fP with <i>list</i> \(&lt;= \fId\fP \(&lt;= <i>list</i> + <i>range</i> - 1 + are deleted.</p> + <p>All storage locations allocated to the specified display lists are freed, + and the names are available for reuse at a later time. + Names within the range that do not have an associated display list are ignored. + If <i>range</i> is 0, nothing happens.</p> + </dd> + <dt class='head--doc'><span id='p-list'></span>Parameter <code class='parameter'>list</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the integer name of the first display list to delete.</p> + </dd> + <dt class='head--doc'><span id='p-range'></span>Parameter <code class='parameter'>range</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the number of display lists to delete.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>range</i> is negative.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDeleteLists</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDepthFunc</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDepthFunc</span>(</b><code class='datatype'>int</code> <code class='argument'>func</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glDepthFunc</code> specifies the function used to compare each incoming pixel depth value + with the depth value present in the depth buffer. + The comparison is performed only if depth testing is enabled. + (See <code>glEnable</code> and <code>glDisable</code> of <code>GL_DEPTH_TEST</code>.)</p> + <p><i>func</i> specifies the conditions under which the pixel will be drawn. + The comparison functions are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_NEVER</code> + </td><td>Never passes. + </td></tr> + <tr><td><code>GL_LESS</code> + </td><td>Passes if the incoming depth value is less than the stored depth value. + </td></tr> + <tr><td><code>GL_EQUAL</code> + </td><td>Passes if the incoming depth value is equal to the stored depth value. + </td></tr> + <tr><td><code>GL_LEQUAL</code> + </td><td>Passes if the incoming depth value is less than or equal to + the stored depth value. + </td></tr> + <tr><td><code>GL_GREATER</code> + </td><td>Passes if the incoming depth value is greater than the stored depth value. + </td></tr> + <tr><td><code>GL_NOTEQUAL</code> + </td><td>Passes if the incoming depth value is not equal to the stored depth value. + </td></tr> + <tr><td><code>GL_GEQUAL</code> + </td><td>Passes if the incoming depth value is greater than or equal to + the stored depth value. + </td></tr> + <tr><td><code>GL_ALWAYS</code> + </td><td>Always passes. + </td></tr> + </table> + </p> + <p>The initial value of <i>func</i> is <code>GL_LESS</code>. + Initially, depth testing is disabled. + .NOTES + Even if the depth buffer exists and the depth mask is non-zero, the + depth buffer is not updated if the depth test is disabled.</p> + </dd> + <dt class='head--doc'><span id='p-func'></span>Parameter <code class='parameter'>func</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the depth comparison function. + Symbolic constants + <code>GL_NEVER</code>, + <code>GL_LESS</code>, + <code>GL_EQUAL</code>, + <code>GL_LEQUAL</code>, + <code>GL_GREATER</code>, + <code>GL_NOTEQUAL</code>, + <code>GL_GEQUAL</code>, and + <code>GL_ALWAYS</code> are accepted. + The initial value is <code>GL_LESS</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>func</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDepthFunc</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDepthMask</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDepthMask</span>(</b><code class='datatype'>int</code> <code class='argument'>flag</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glDepthMask</code> specifies whether the depth buffer is enabled for writing. + If <i>flag</i> is <code>GL_FALSE</code>, + depth buffer writing is disabled. + Otherwise, it is enabled. + Initially, depth buffer writing is enabled.</p> + </dd> + <dt class='head--doc'><span id='p-flag'></span>Parameter <code class='parameter'>flag</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies whether the depth buffer is enabled for writing. + If <i>flag</i> is <code>GL_FALSE</code>, + depth buffer writing is disabled. + Otherwise, it is enabled. + Initially, depth buffer writing is enabled.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glDepthMask</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDepthRange</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDepthRange</span>(</b><code class='datatype'>float</code> <code class='argument'>zNear</code>, <code class='datatype'>float</code> <code class='argument'>zFar</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>After clipping and division by <i>w</i>, + depth coordinates range from -1 to 1, + corresponding to the near and far clipping planes. + <code>glDepthRange</code> specifies a linear mapping of the normalized depth coordinates + in this range to window depth coordinates. + Regardless of the actual depth buffer implementation, + window coordinate depth values are treated as though they range + from 0 through 1 (like color components). + Thus, + the values accepted by <code>glDepthRange</code> are both clamped to this range + before they are accepted.</p> + <p>The setting of (0,1) maps the near plane to 0 and + the far plane to 1. + With this mapping, + the depth buffer range is fully utilized.</p> + </dd> + <dt class='head--doc'><span id='p-zNear'></span>Parameter <code class='parameter'>zNear</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the mapping of the near clipping plane to window coordinates. + The initial value is 0.</p> + </dd> + <dt class='head--doc'><span id='p-zFar'></span>Parameter <code class='parameter'>zFar</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the mapping of the far clipping plane to window coordinates. + The initial value is 1.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glDepthRange</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDisable</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDisable</span>(</b><code class='datatype'>int</code> <code class='argument'>cap</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glEnable</code> and <code>glDisable</code> enable and disable various capabilities. + Use <code>glIsEnabled</code> or <code>glGet</code> to determine the current setting + of any capability. The initial value for each capability with the + exception of <code>GL_DITHER</code> is <code>GL_FALSE</code>. The initial value for + <code>GL_DITHER</code> is <code>GL_TRUE</code>. </p> + <p>Both <code>glEnable</code> and <code>glDisable</code> take a single argument, <i>cap</i>, + which can assume one of the following values:</p> + <p><table class='box'> + <tr><td><code>GL_ALPHA_TEST</code> + </td><td>If enabled, + do alpha testing. See + <code>glAlphaFunc</code>. + </td></tr> + <tr><td><code>GL_AUTO_NORMAL</code> + </td><td>If enabled, + generate normal vectors when either + <code>GL_MAP2_VERTEX_3</code> or + <code>GL_MAP2_VERTEX_4</code> is used to generate vertices. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_BLEND</code> + </td><td>If enabled, + blend the incoming RGBA color values with the values in the color + buffers. See <code>glBlendFunc</code>. + </td></tr> + <tr><td><code>GL_CLIP_PLANE</code><i>i</i> + </td><td>If enabled, + clip geometry against user-defined clipping plane <i>i</i>. + See <code>glClipPlane</code>. + </td></tr> + <tr><td><code>GL_COLOR_LOGIC_OP</code> + </td><td>If enabled, + apply the currently selected logical operation to the incoming RGBA + color and color buffer values. See <code>glLogicOp</code>. + </td></tr> + <tr><td><code>GL_COLOR_MATERIAL</code> + </td><td>If enabled, + have one or more material parameters track the current color. + See <code>glColorMaterial</code>. + </td></tr> + <tr><td><code>GL_CULL_FACE</code> + </td><td>If enabled, + cull polygons based on their winding in window coordinates. + See <code>glCullFace</code>. + </td></tr> + <tr><td><code>GL_DEPTH_TEST</code> + </td><td>If enabled, + do depth comparisons and update the depth buffer. Note that even if + the depth buffer exists and the depth mask is non-zero, the + depth buffer is not updated if the depth test is disabled. See + <code>glDepthFunc</code> and +  + <code>glDepthRange</code>. + </td></tr> + <tr><td><code>GL_DITHER</code> + </td><td>If enabled, + dither color components or indices before they are written to the + color buffer. + </td></tr> + <tr><td><code>GL_FOG</code> + </td><td>If enabled, + blend a fog color into the posttexturing color. + See <code>glFog</code>. + </td></tr> + <tr><td><code>GL_INDEX_LOGIC_OP</code> + </td><td>If enabled, + apply the currently selected logical operation to the incoming index and color + buffer indices. See +  + <code>glLogicOp</code>. + </td></tr> + <tr><td><code>GL_LIGHT</code><i>i</i> + </td><td>If enabled, + include light <i>i</i> in the evaluation of the lighting + equation. See <code>glLightModel</code> and <code>glLight</code>. + </td></tr> + <tr><td><code>GL_LIGHTING</code> + </td><td>If enabled, + use the current lighting parameters to compute the vertex color or index. + Otherwise, simply associate the current color or index with each + vertex. See +  + <code>glMaterial</code>, <code>glLightModel</code>, and <code>glLight</code>. + </td></tr> + <tr><td><code>GL_LINE_SMOOTH</code> + </td><td>If enabled, + draw lines with correct filtering. + Otherwise, + draw aliased lines. + See <code>glLineWidth</code>. + </td></tr> + <tr><td><code>GL_LINE_STIPPLE</code> + </td><td>If enabled, + use the current line stipple pattern when drawing lines. See + <code>glLineStipple</code>. + </td></tr> + <tr><td><code>GL_MAP1_COLOR_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate RGBA values. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_INDEX</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate color indices. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_NORMAL</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate normals. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_1</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i> + texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_2</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i> and + <i>t</i> texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i>, + <i>t</i>, and + <i>r</i> texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i>, + <i>t</i>, + <i>r</i>, and + <i>q</i> texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_VERTEX_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>x</i>, <i>y</i>, and <i>z</i> vertex coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_VERTEX_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + homogeneous + <i>x</i>, + <i>y</i>, + <i>z</i>, and + <i>w</i> vertex coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP2_COLOR_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate RGBA values. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_INDEX</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate color indices. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_NORMAL</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate normals. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_1</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i> + texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_2</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i> and + <i>t</i> texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i>, + <i>t</i>, and + <i>r</i> texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i>, + <i>t</i>, + <i>r</i>, and + <i>q</i> texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_VERTEX_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>x</i>, <i>y</i>, and <i>z</i> vertex coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_VERTEX_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + homogeneous + <i>x</i>, + <i>y</i>, + <i>z</i>, and + <i>w</i> vertex coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_NORMALIZE</code> + </td><td>If enabled, + normal vectors specified with <code>glNormal</code> are scaled to unit length + after transformation. See <code>glNormal</code>. + </td></tr> + <tr><td><code>GL_POINT_SMOOTH</code> + </td><td>If enabled, + draw points with proper filtering. + Otherwise, + draw aliased points. + See <code>glPointSize</code>. + </td></tr> + <tr><td><code>GL_POLYGON_OFFSET_FILL</code> + </td><td>If enabled, and if the polygon is rendered in + <code>GL_FILL</code> mode, an offset is added to depth values of a polygon's + fragments before the depth comparison is performed. See + <code>glPolygonOffset</code>. + </td></tr> + <tr><td><code>GL_POLYGON_OFFSET_LINE</code> + </td><td>If enabled, and if the polygon is rendered in + <code>GL_LINE</code> mode, an offset is added to depth values of a polygon's + fragments before the depth comparison is performed. See <code>glPolygonOffset</code>. + </td></tr> + <tr><td><code>GL_POLYGON_OFFSET_POINT</code> + </td><td>If enabled, an offset is added to depth values of a polygon's fragments + before the depth comparison is performed, if the polygon is rendered in + <code>GL_POINT</code> mode. See +  + <code>glPolygonOffset</code>. + </td></tr> + <tr><td><code>GL_POLYGON_SMOOTH</code> + </td><td>If enabled, draw polygons with proper filtering. + Otherwise, draw aliased polygons. For correct anti-aliased polygons, + an alpha buffer is needed and the polygons must be sorted front to + back. + </td></tr> + <tr><td><code>GL_POLYGON_STIPPLE</code> + </td><td>If enabled, + use the current polygon stipple pattern when rendering + polygons. See <code>glPolygonStipple</code>. + </td></tr> + <tr><td><code>GL_SCISSOR_TEST</code> + </td><td>If enabled, + discard fragments that are outside the scissor rectangle. + See <code>glScissor</code>. + </td></tr> + <tr><td><code>GL_STENCIL_TEST</code> + </td><td>If enabled, + do stencil testing and update the stencil buffer. + See <code>glStencilFunc</code> and <code>glStencilOp</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_1D</code> + </td><td>If enabled, + one-dimensional texturing is performed + (unless two-dimensional texturing is also enabled). See <code>glTexImage1D</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_2D</code> + </td><td>If enabled, + two-dimensional texturing is performed. See <code>glTexImage2D</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_Q</code> + </td><td>If enabled, + the <i>q</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>q</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_R</code> + </td><td>If enabled, + the <i>r</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>r</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_S</code> + </td><td>If enabled, + the <i>s</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>s</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_T</code> + </td><td>If enabled, + the <i>t</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>t</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating a GL capability.</p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating a GL capability.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>cap</i> is not one of the values + listed previously.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEnable</code> or <code>glDisable</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDisableClientState</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDisableClientState</span>(</b><code class='datatype'>int</code> <code class='argument'>cap</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glEnableClientState</code> and <code>glDisableClientState</code> + enable or disable individual client-side capabilities. By default, all + client-side capabilities are disabled. + Both + <code>glEnableClientState</code> and <code>glDisableClientState</code> take a + single argument, <i>cap</i>, which can assume one of the following + values: </p> + <p><table class='box'> + <tr><td><code>GL_COLOR_ARRAY</code> + </td><td>If enabled, the color array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or + <code>glDrawElement</code> is called. See + <code>glColorPointer</code>. + </td></tr> + <tr><td><code>GL_EDGE_FLAG_ARRAY</code> + </td><td>If enabled, the edge flag array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is called. See + <code>glEdgeFlagPointer</code>. + </td></tr> + <tr><td><code>GL_INDEX_ARRAY</code> + </td><td>If enabled, the index array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or + <code>glDrawElements</code> is called. See + <code>glIndexPointer</code>. + </td></tr> + <tr><td><code>GL_NORMAL_ARRAY</code> + </td><td>If enabled, the normal array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is called. See + <code>glNormalPointer</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_COORD_ARRAY</code> + </td><td>If enabled, the texture coordinate array is enabled for writing and + used for rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is + called. See <code>glTexCoordPointer</code>. + </td></tr> + <tr><td><code>GL_VERTEX_ARRAY</code> + </td><td>If enabled, the vertex array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or + <code>glDrawElements</code> is called. See + <code>glVertexPointer</code>. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the capability to enable. + Symbolic constants + <code>GL_COLOR_ARRAY</code>, + <code>GL_EDGE_FLAG_ARRAY</code>, + <code>GL_INDEX_ARRAY</code>, + <code>GL_NORMAL_ARRAY</code>, + <code>GL_TEXTURE_COORD_ARRAY</code>, and + <code>GL_VERTEX_ARRAY</code> + are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the capability to disable.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>cap</i> is not an accepted value.</p> + <p><code>glEnableClientState</code> is not allowed between the execution of <code>glBegin</code> and the + corresponding <code>glEnd</code>, but an error may or may not be generated. If + no error is generated, the behavior is undefined.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDrawArrays</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDrawArrays</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code>, <code class='datatype'>int</code> <code class='argument'>first</code>, <code class='datatype'>int</code> <code class='argument'>count</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glDrawArrays</code> specifies multiple geometric primitives + with very few subroutine calls. Instead of calling a GL procedure + to pass each individual vertex, normal, texture coordinate, edge + flag, or color, you can prespecify + separate arrays of vertexes, normals, and colors and use them to + construct a sequence of primitives with a single + call to <code>glDrawArrays</code>.</p> + <p>When <code>glDrawArrays</code> is called, it uses <i>count</i> sequential elements from each + enabled array to construct a sequence of geometric primitives, + beginning with element <i>first</i>. <i>mode</i> specifies what kind of + primitives are constructed, and how the array elements + construct those primitives. If <code>GL_VERTEX_ARRAY</code> is not enabled, no + geometric primitives are generated.</p> + <p>Vertex attributes that are modified by <code>glDrawArrays</code> have an + unspecified value after <code>glDrawArrays</code> returns. For example, if + <code>GL_COLOR_ARRAY</code> is enabled, the value of the current color is + undefined after <code>glDrawArrays</code> executes. Attributes that aren't + modified remain well defined.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies what kind of primitives to render. + Symbolic constants + <code>GL_POINTS</code>, + <code>GL_LINE_STRIP</code>, + <code>GL_LINE_LOOP</code>, + <code>GL_LINES</code>, + <code>GL_TRIANGLE_STRIP</code>, + <code>GL_TRIANGLE_FAN</code>, + <code>GL_TRIANGLES</code>, + <code>GL_QUAD_STRIP</code>, + <code>GL_QUADS</code>, + and <code>GL_POLYGON</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-first'></span>Parameter <code class='parameter'>first</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the starting index in the enabled arrays.</p> + </dd> + <dt class='head--doc'><span id='p-count'></span>Parameter <code class='parameter'>count</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the number of indices to be rendered.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>count</i> is negative.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDrawArrays</code> is executed between + the execution of <code>glBegin</code> and the corresponding <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDrawBuffer</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDrawBuffer</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>When colors are written to the frame buffer, + they are written into the color buffers specified by <code>glDrawBuffer</code>. + The specifications are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_NONE</code> + </td><td>No color buffers are written. + </td></tr> + <tr><td><code>GL_FRONT_LEFT</code> + </td><td>Only the front left color buffer is written. + </td></tr> + <tr><td><code>GL_FRONT_RIGHT</code> + </td><td>Only the front right color buffer is written. + </td></tr> + <tr><td><code>GL_BACK_LEFT</code> + </td><td>Only the back left color buffer is written. + </td></tr> + <tr><td><code>GL_BACK_RIGHT</code> + </td><td>Only the back right color buffer is written. + </td></tr> + <tr><td><code>GL_FRONT</code> + </td><td>Only the front left and front right color buffers are written. + If there is no front right color buffer, + only the front left color buffer is written. + </td></tr> + <tr><td><code>GL_BACK</code> + </td><td>Only the back left and back right color buffers are written. + If there is no back right color buffer, + only the back left color buffer is written. + </td></tr> + <tr><td><code>GL_LEFT</code> + </td><td>Only the front left and back left color buffers are written. + If there is no back left color buffer, + only the front left color buffer is written. + </td></tr> + <tr><td><code>GL_RIGHT</code> + </td><td>Only the front right and back right color buffers are written. + If there is no back right color buffer, + only the front right color buffer is written. + </td></tr> + <tr><td><code>GL_FRONT_AND_BACK</code> + </td><td>All the front and back color buffers + (front left, front right, back left, back right) + are written. + If there are no back color buffers, + only the front left and front right color buffers are written. + If there are no right color buffers, + only the front left and back left color buffers are written. + If there are no right or back color buffers, + only the front left color buffer is written. + </td></tr> + <tr><td><code>GL_AUX</code><i>i</i> + </td><td>Only auxiliary color buffer <i>i</i> is written. + </td></tr> + </table> + </p> + <p>If more than one color buffer is selected for drawing, + then blending or logical operations are computed and applied independently + for each color buffer and can produce different results in each buffer.</p> + <p>Monoscopic contexts include only + .I left + buffers, and stereoscopic contexts include both + .I left + and + .I right + buffers. + Likewise, single-buffered contexts include only + .I front + buffers, and double-buffered contexts include both + .I front + and + .I back + buffers. + The context is selected at GL initialization.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies up to four color buffers to be drawn into. + Symbolic constants + <code>GL_NONE</code>, + <code>GL_FRONT_LEFT</code>, + <code>GL_FRONT_RIGHT</code>, + <code>GL_BACK_LEFT</code>, + <code>GL_BACK_RIGHT</code>, + <code>GL_FRONT</code>, + <code>GL_BACK</code>, + <code>GL_LEFT</code>, + <code>GL_RIGHT</code>, + <code>GL_FRONT_AND_BACK</code>, and + <code>GL_AUX</code><i>i</i>, + where <i>i</i> is between 0 and ``<code>GL_AUX_BUFFERS</code>'' -1, + are accepted (<code>GL_AUX_BUFFERS</code> is not the upper limit; use <code>glGet</code> + to query the number of available aux buffers.) + The initial value is <code>GL_FRONT</code> for single-buffered contexts, + and <code>GL_BACK</code> for double-buffered contexts.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if none of the buffers indicated + by <i>mode</i> exists.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDrawBuffer</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glDrawPixels</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glDrawPixels</span>(</b><code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>width</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>height</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>format</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>type</code>, <code class='datatype'>array</code>(<code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>)) <code class='argument'>pixels</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glDrawPixels</code> reads pixel data from memory and writes it into the frame buffer + relative to the current raster position. + Use <code>glRasterPos</code> to set the current raster position; use + <code>glGet</code> with argument <code>GL_CURRENT_RASTER_POSITION</code> + to query the raster position.</p> + <p>Several parameters define the encoding of pixel data in memory + and control the processing of the pixel data + before it is placed in the frame buffer. + These parameters are set with four commands: + <code>glPixelStore</code>, + <code>glPixelTransfer</code>, + <code>glPixelMap</code>, and <code>glPixelZoom</code>. + This reference page describes the effects on <code>glDrawPixels</code> of many, + but not all, of the parameters specified by these four commands.</p> + <p>Data is read from <i>pixels</i> as a sequence of signed or unsigned bytes, + signed or unsigned shorts, + signed or unsigned integers, + or single-precision floating-point values, + depending on <i>type</i>. + Each of these bytes, shorts, integers, or floating-point values is + interpreted as one color or depth component, + or one index, + depending on <i>format</i>. + Indices are always treated individually. + Color components are treated as groups of one, + two, + three, + or four values, + again based on <i>format</i>. + Both individual indices and groups of components are + referred to as pixels. + If <i>type</i> is <code>GL_BITMAP</code>, + the data must be unsigned bytes, + and <i>format</i> must be either <code>GL_COLOR_INDEX</code> or <code>GL_STENCIL_INDEX</code>. + Each unsigned byte is treated as eight 1-bit pixels, + with bit ordering determined by + <code>GL_UNPACK_LSB_FIRST</code> (see <code>glPixelStore</code>).</p> + <p><i>width</i>times<i>height</i> pixels are read from memory, + starting at location <i>pixels</i>. + By default, these pixels are taken from adjacent memory locations, + except that after all <i>width</i> pixels are read, + the read pointer is advanced to the next four-byte boundary. + The four-byte row alignment is specified by <code>glPixelStore</code> with + argument <code>GL_UNPACK_ALIGNMENT</code>, + and it can be set to one, two, four, or eight bytes. + Other pixel store parameters specify different read pointer advancements, + both before the first pixel is read + and after all <i>width</i> pixels are read. + See the </p> + <p><code>glPixelStore</code> reference page for details on these options.</p> + <p>The <i>width</i>times<i>height</i> pixels that are read from memory are + each operated on in the same way, + based on the values of several parameters specified by <code>glPixelTransfer</code> + and <code>glPixelMap</code>. + The details of these operations, + as well as the target buffer into which the pixels are drawn, + are specific to the format of the pixels, + as specified by <i>format</i>. + <i>format</i> can assume one of eleven symbolic values:</p> + <p><table class='box'> + <tr><td><code>GL_COLOR_INDEX</code> + </td><td>Each pixel is a single value, + a color index. + It is converted to fixed-point format, + with an unspecified number of bits to the right of the binary point, + regardless of the memory data type. + Floating-point values convert to true fixed-point values. + Signed and unsigned integer data is converted with all fraction bits + set to 0. + Bitmap data convert to either 0 or 1. +  + Each fixed-point index is then shifted left by <code>GL_INDEX_SHIFT</code> bits + and added to <code>GL_INDEX_OFFSET</code>. + If <code>GL_INDEX_SHIFT</code> is negative, + the shift is to the right. + In either case, zero bits fill otherwise unspecified bit locations in the + result. +  + If the GL is in RGBA mode, + the resulting index is converted to an RGBA pixel + with the help of the <code>GL_PIXEL_MAP_I_TO_R</code>, + <code>GL_PIXEL_MAP_I_TO_G</code>, + <code>GL_PIXEL_MAP_I_TO_B</code>, + and <code>GL_PIXEL_MAP_I_TO_A</code> tables. + If the GL is in color index mode, + and if <code>GL_MAP_COLOR</code> is true, + the index is replaced with the value that it references in lookup table + <code>GL_PIXEL_MAP_I_TO_I</code>. + Whether the lookup replacement of the index is done or not, + the integer part of the index is then ANDed with 2 sup b -1, + where b is the number of bits in a color index buffer. +  + The GL then converts the resulting indices or RGBA colors to fragments + by attaching the current raster position <i>z</i> coordinate and + texture coordinates to each pixel, + then assigning x and y window coordinates to the nth fragment such that + .sp + .RS + .ce + x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" + .sp + .ce + y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf + .ce 0 + .sp + .RE +  + where (x sub r , y sub r) is the current raster position. + These pixel fragments are then treated just like the fragments generated by + rasterizing points, lines, or polygons. + Texture mapping, + fog, + and all the fragment operations are applied before the fragments are written + to the frame buffer. + </td></tr> + <tr><td><code>GL_STENCIL_INDEX</code> + </td><td>Each pixel is a single value, + a stencil index. + It is converted to fixed-point format, + with an unspecified number of bits to the right of the binary point, + regardless of the memory data type. + Floating-point values convert to true fixed-point values. + Signed and unsigned integer data is converted with all fraction bits + set to 0. + Bitmap data convert to either 0 or 1. +  + Each fixed-point index is then shifted left by <code>GL_INDEX_SHIFT</code> bits, + and added to <code>GL_INDEX_OFFSET</code>. + If <code>GL_INDEX_SHIFT</code> is negative, + the shift is to the right. + In either case, zero bits fill otherwise unspecified bit locations in the + result. + If <code>GL_MAP_STENCIL</code> is true, + the index is replaced with the value that it references in lookup table + <code>GL_PIXEL_MAP_S_TO_S</code>. + Whether the lookup replacement of the index is done or not, + the integer part of the index is then ANDed with 2 sup b -1, + where b is the number of bits in the stencil buffer. + The resulting stencil indices are then written to the stencil buffer + such that the nth index is written to location + </td></tr> + </table> + </p> + <p>.RS + .ce + x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" + .sp + .ce + y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf + .fi + .sp + .RE</p> + <p>where (x sub r , y sub r) is the current raster position. + Only the pixel ownership test, + the scissor test, + and the stencil writemask affect these write operations.</p> + <p><table class='box'> + <tr><td><code>GL_DEPTH_COMPONENT</code> + </td><td>Each pixel is a single-depth component. + Floating-point data is converted directly to an internal floating-point + format with unspecified precision. + Signed integer data is mapped linearly to the internal floating-point + format such that the most positive representable integer value maps to 1.0, + and the most negative representable value maps to -1.0. + Unsigned integer data is mapped similarly: + the largest integer value maps to 1.0, + and 0 maps to 0.0. + The resulting floating-point depth value is then multiplied by + by <code>GL_DEPTH_SCALE</code> and added to <code>GL_DEPTH_BIAS</code>. + The result is clamped to the range [0,1]. +  + The GL then converts the resulting depth components to fragments + by attaching the current raster position color or color index and + texture coordinates to each pixel, + then assigning x and y window coordinates to the nth fragment such that + </td></tr> + </table> + </p> + <p>.RS + .ce + x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" + .sp + .ce + y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf + .ce 0 + .sp + .RE</p> + <p>where (x sub r , y sub r) is the current raster position. + These pixel fragments are then treated just like the fragments generated by + rasterizing points, lines, or polygons. + Texture mapping, + fog, + and all the fragment operations are applied before the fragments are written + to the frame buffer.</p> + <p><table class='box'> + <tr><td><code>GL_RGBA</code> + </td><td>Each pixel is a four-component group: for <code>GL_RGBA</code>, the red + component is first, followed by green, followed by blue, followed by + alpha. + Floating-point values are converted directly to an internal floating-point + format with unspecified precision. + Signed integer values are mapped linearly to the internal floating-point + format such that the most positive representable integer value maps to 1.0, + and the most negative representable value maps to -1.0. (Note that + this mapping does not convert 0 precisely to 0.0.) + Unsigned integer data is mapped similarly: + the largest integer value maps to 1.0, + and 0 maps to 0.0. + The resulting floating-point color values are then multiplied + by <code>GL_c_SCALE</code> and added to <code>GL_c_BIAS</code>, + where <i>c</i> is RED, GREEN, BLUE, and ALPHA + for the respective color components. + The results are clamped to the range [0,1]. +  + If <code>GL_MAP_COLOR</code> is true, + each color component is scaled by the size of lookup table + <code>GL_PIXEL_MAP_c_TO_c</code>, + then replaced by the value that it references in that table. + <i>c</i> is R, G, B, or A respectively. +  + The GL then converts the resulting RGBA colors to fragments + by attaching the current raster position <i>z</i> coordinate and + texture coordinates to each pixel, + then assigning x and y window coordinates to the nth fragment such that + </td></tr> + </table> + </p> + <p>.RS + .ce + x sub n ~=~ x sub r ~+~ n ~ roman mod ~ "width" + .sp + .ce + y sub n ~=~ y sub r ~+~ \(lf ~ n / "width" ~ \(rf + .ce 0 + .sp + .RE</p> + <p>where (x sub r , y sub r) is the current raster position. + These pixel fragments are then treated just like the fragments generated by + rasterizing points, lines, or polygons. + Texture mapping, + fog, + and all the fragment operations are applied before the fragments are written + to the frame buffer.</p> + <p><table class='box'> + <tr><td><code>GL_RED</code> + </td><td>Each pixel is a single red component. + This component is converted to the internal floating-point format in + the same way the red component of an RGBA pixel is. It is + then converted to an RGBA pixel with green and blue set to 0, + and alpha set to 1. + After this conversion, the pixel is treated as if it had been read + as an RGBA pixel. + </td></tr> + <tr><td><code>GL_GREEN</code> + </td><td>Each pixel is a single green component. + This component is converted to the internal floating-point format in + the same way the green component of an RGBA pixel is. + It is then converted to an RGBA pixel with red and blue set to 0, + and alpha set to 1. + After this conversion, the pixel is treated as if it had been read + as an RGBA pixel. + </td></tr> + <tr><td><code>GL_BLUE</code> + </td><td>Each pixel is a single blue component. + This component is converted to the internal floating-point format in + the same way the blue component of an RGBA pixel is. + It is then converted to an RGBA pixel with red and green set to 0, + and alpha set to 1. + After this conversion, the pixel is treated as if it had been read + as an RGBA pixel. + </td></tr> + <tr><td><code>GL_ALPHA</code> + </td><td>Each pixel is a single alpha component. + This component is converted to the internal floating-point format in + the same way the alpha component of an RGBA pixel is. + It is then converted to an RGBA pixel with red, green, and blue set to 0. + After this conversion, the pixel is treated as if it had been read + as an RGBA pixel. + </td></tr> + <tr><td><code>GL_RGB</code> + </td><td>Each pixel is a three-component group: + red first, followed by green, followed by blue. + Each component is converted to the internal floating-point format in + the same way the red, green, and blue components of an RGBA pixel are. + The color triple is converted to an RGBA pixel with alpha set to 1. + After this conversion, the pixel is treated as if it had been read + as an RGBA pixel. + </td></tr> + <tr><td><code>GL_LUMINANCE</code> + </td><td>Each pixel is a single luminance component. + This component is converted to the internal floating-point format in + the same way the red component of an RGBA pixel is. + It is then converted to an RGBA pixel with red, green, and blue set to the + converted luminance value, + and alpha set to 1. + After this conversion, the pixel is treated as if it had been read + as an RGBA pixel. + </td></tr> + <tr><td><code>GL_LUMINANCE_ALPHA</code> + </td><td>Each pixel is a two-component group: + luminance first, followed by alpha. + The two components are converted to the internal floating-point format in + the same way the red component of an RGBA pixel is. + They are then converted to an RGBA pixel with red, green, and blue set to the + converted luminance value, + and alpha set to the converted alpha value. + After this conversion, the pixel is treated as if it had been read + as an RGBA pixel. + </td></tr> + </table> + </p> + <p>The following table summarizes the meaning of the valid constants for the + <i>type</i> parameter: + .sp 2 + .TS + center box ; + ci | ci + c | c . + type corresponding type + = + GL_UNSIGNED_BYTE unsigned 8-bit integer + GL_BYTE signed 8-bit integer + GL_BITMAP single bits in unsigned 8-bit integers + GL_UNSIGNED_SHORT unsigned 16-bit integer + GL_SHORT signed 16-bit integer + GL_UNSIGNED_INT unsigned 32-bit integer + GL_INT 32-bit integer + GL_FLOAT single-precision floating-point + .TE + .sp</p> + <p>The rasterization described so far assumes pixel zoom factors of 1. + If </p> + <p><code>glPixelZoom</code> is used to change the x and y pixel zoom factors, + pixels are converted to fragments as follows. + If (x sub r, y sub r) is the current raster position, + and a given pixel is in the nth column and mth row + of the pixel rectangle, + then fragments are generated for pixels whose centers are in the rectangle + with corners at + .sp + .RS + .ce + (x sub r + zoom sub x n, y sub r + zoom sub y m) + .sp + .ce + (x sub r + zoom sub x (n + 1), y sub r + zoom sub y ( m + 1 )) + .ce 0 + .sp + .RE</p> + <p>where zoom sub x is the value of <code>GL_ZOOM_X</code> and + zoom sub y is the value of <code>GL_ZOOM_Y</code>.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the dimensions of the pixel rectangle to be written + into the frame buffer.</p> + </dd> + <dt class='head--doc'><span id='p-format'></span>Parameter <code class='parameter'>format</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the format of the pixel data. + Symbolic constants + <code>GL_COLOR_INDEX</code>, + <code>GL_STENCIL_INDEX</code>, + <code>GL_DEPTH_COMPONENT</code>, + <code>GL_RGBA</code>, + <code>GL_RED</code>, + <code>GL_GREEN</code>, + <code>GL_BLUE</code>, + <code>GL_ALPHA</code>, + <code>GL_RGB</code>, + <code>GL_LUMINANCE</code>, and + <code>GL_LUMINANCE_ALPHA</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-type'></span>Parameter <code class='parameter'>type</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the data type for <i>pixels</i>. + Symbolic constants + <code>GL_UNSIGNED_BYTE</code>, + <code>GL_BYTE</code>, + <code>GL_BITMAP</code>, + <code>GL_UNSIGNED_SHORT</code>, + <code>GL_SHORT</code>, + <code>GL_UNSIGNED_INT</code>, + <code>GL_INT</code>, and + <code>GL_FLOAT</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-pixels'></span>Parameter <code class='parameter'>pixels</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to the pixel data.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if either <i>width</i> or <i>height</i> is negative.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>format</i> or <i>type</i> is not one of + the accepted values.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <i>format</i> is + <code>GL_RED</code>, + <code>GL_GREEN</code>, + <code>GL_BLUE</code>, + <code>GL_ALPHA</code>, + <code>GL_RGB</code>, + <code>GL_RGBA</code>, + <code>GL_LUMINANCE</code>, + or + <code>GL_LUMINANCE_ALPHA</code>, + and the GL is in color index mode.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is <code>GL_BITMAP</code> and + <i>format</i> is not either <code>GL_COLOR_INDEX</code> or <code>GL_STENCIL_INDEX</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <i>format</i> is <code>GL_STENCIL_INDEX</code> + and there is no stencil buffer.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glDrawPixels</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glEdgeFlag</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEdgeFlag</span>(</b><code class='datatype'>int</code> <code class='argument'>flag</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Each vertex of a polygon, + separate triangle, + or separate quadrilateral specified between a <code>glBegin</code>/<code>glEnd</code> pair + is marked as the start of either a boundary or nonboundary edge. + If the current edge flag is true when the vertex is specified, + the vertex is marked as the start of a boundary edge. + Otherwise, the vertex is marked as the start of a nonboundary edge. + <code>glEdgeFlag</code> sets the edge flag bit to <code>GL_TRUE</code> if <i>flag</i> is <code>GL_TRUE</code>, + and to <code>GL_FALSE</code> otherwise.</p> + <p>The vertices of connected triangles and connected quadrilaterals are always + marked as boundary, + regardless of the value of the edge flag.</p> + <p>Boundary and nonboundary edge flags on vertices are significant only if + <code>GL_POLYGON_MODE</code> is set to <code>GL_POINT</code> or <code>GL_LINE</code>. + See <code>glPolygonMode</code>.</p> + </dd> + <dt class='head--doc'><span id='p-flag'></span>Parameter <code class='parameter'>flag</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the current edge flag value, + either <code>GL_TRUE</code> or <code>GL_FALSE</code>. The initial value is <code>GL_TRUE</code>.</p> + </dd> + <dt class='head--doc'><span id='p-flag'></span>Parameter <code class='parameter'>flag</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array that contains a single boolean element, + which replaces the current edge flag value.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glEnable</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEnable</span>(</b><code class='datatype'>int</code> <code class='argument'>cap</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glEnable</code> and <code>glDisable</code> enable and disable various capabilities. + Use <code>glIsEnabled</code> or <code>glGet</code> to determine the current setting + of any capability. The initial value for each capability with the + exception of <code>GL_DITHER</code> is <code>GL_FALSE</code>. The initial value for + <code>GL_DITHER</code> is <code>GL_TRUE</code>. </p> + <p>Both <code>glEnable</code> and <code>glDisable</code> take a single argument, <i>cap</i>, + which can assume one of the following values:</p> + <p><table class='box'> + <tr><td><code>GL_ALPHA_TEST</code> + </td><td>If enabled, + do alpha testing. See + <code>glAlphaFunc</code>. + </td></tr> + <tr><td><code>GL_AUTO_NORMAL</code> + </td><td>If enabled, + generate normal vectors when either + <code>GL_MAP2_VERTEX_3</code> or + <code>GL_MAP2_VERTEX_4</code> is used to generate vertices. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_BLEND</code> + </td><td>If enabled, + blend the incoming RGBA color values with the values in the color + buffers. See <code>glBlendFunc</code>. + </td></tr> + <tr><td><code>GL_CLIP_PLANE</code><i>i</i> + </td><td>If enabled, + clip geometry against user-defined clipping plane <i>i</i>. + See <code>glClipPlane</code>. + </td></tr> + <tr><td><code>GL_COLOR_LOGIC_OP</code> + </td><td>If enabled, + apply the currently selected logical operation to the incoming RGBA + color and color buffer values. See <code>glLogicOp</code>. + </td></tr> + <tr><td><code>GL_COLOR_MATERIAL</code> + </td><td>If enabled, + have one or more material parameters track the current color. + See <code>glColorMaterial</code>. + </td></tr> + <tr><td><code>GL_CULL_FACE</code> + </td><td>If enabled, + cull polygons based on their winding in window coordinates. + See <code>glCullFace</code>. + </td></tr> + <tr><td><code>GL_DEPTH_TEST</code> + </td><td>If enabled, + do depth comparisons and update the depth buffer. Note that even if + the depth buffer exists and the depth mask is non-zero, the + depth buffer is not updated if the depth test is disabled. See + <code>glDepthFunc</code> and +  + <code>glDepthRange</code>. + </td></tr> + <tr><td><code>GL_DITHER</code> + </td><td>If enabled, + dither color components or indices before they are written to the + color buffer. + </td></tr> + <tr><td><code>GL_FOG</code> + </td><td>If enabled, + blend a fog color into the posttexturing color. + See <code>glFog</code>. + </td></tr> + <tr><td><code>GL_INDEX_LOGIC_OP</code> + </td><td>If enabled, + apply the currently selected logical operation to the incoming index and color + buffer indices. See +  + <code>glLogicOp</code>. + </td></tr> + <tr><td><code>GL_LIGHT</code><i>i</i> + </td><td>If enabled, + include light <i>i</i> in the evaluation of the lighting + equation. See <code>glLightModel</code> and <code>glLight</code>. + </td></tr> + <tr><td><code>GL_LIGHTING</code> + </td><td>If enabled, + use the current lighting parameters to compute the vertex color or index. + Otherwise, simply associate the current color or index with each + vertex. See +  + <code>glMaterial</code>, <code>glLightModel</code>, and <code>glLight</code>. + </td></tr> + <tr><td><code>GL_LINE_SMOOTH</code> + </td><td>If enabled, + draw lines with correct filtering. + Otherwise, + draw aliased lines. + See <code>glLineWidth</code>. + </td></tr> + <tr><td><code>GL_LINE_STIPPLE</code> + </td><td>If enabled, + use the current line stipple pattern when drawing lines. See + <code>glLineStipple</code>. + </td></tr> + <tr><td><code>GL_MAP1_COLOR_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate RGBA values. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_INDEX</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate color indices. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_NORMAL</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate normals. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_1</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i> + texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_2</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i> and + <i>t</i> texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i>, + <i>t</i>, and + <i>r</i> texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_TEXTURE_COORD_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>s</i>, + <i>t</i>, + <i>r</i>, and + <i>q</i> texture coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_VERTEX_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + <i>x</i>, <i>y</i>, and <i>z</i> vertex coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP1_VERTEX_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord1</code>, + <code>glEvalMesh1</code>, and + <code>glEvalPoint1</code> generate + homogeneous + <i>x</i>, + <i>y</i>, + <i>z</i>, and + <i>w</i> vertex coordinates. + See <code>glMap1</code>. + </td></tr> + <tr><td><code>GL_MAP2_COLOR_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate RGBA values. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_INDEX</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate color indices. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_NORMAL</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate normals. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_1</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i> + texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_2</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i> and + <i>t</i> texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i>, + <i>t</i>, and + <i>r</i> texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_TEXTURE_COORD_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>s</i>, + <i>t</i>, + <i>r</i>, and + <i>q</i> texture coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_VERTEX_3</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + <i>x</i>, <i>y</i>, and <i>z</i> vertex coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_MAP2_VERTEX_4</code> + </td><td>If enabled, + calls to + <code>glEvalCoord2</code>, + <code>glEvalMesh2</code>, and + <code>glEvalPoint2</code> generate + homogeneous + <i>x</i>, + <i>y</i>, + <i>z</i>, and + <i>w</i> vertex coordinates. + See <code>glMap2</code>. + </td></tr> + <tr><td><code>GL_NORMALIZE</code> + </td><td>If enabled, + normal vectors specified with <code>glNormal</code> are scaled to unit length + after transformation. See <code>glNormal</code>. + </td></tr> + <tr><td><code>GL_POINT_SMOOTH</code> + </td><td>If enabled, + draw points with proper filtering. + Otherwise, + draw aliased points. + See <code>glPointSize</code>. + </td></tr> + <tr><td><code>GL_POLYGON_OFFSET_FILL</code> + </td><td>If enabled, and if the polygon is rendered in + <code>GL_FILL</code> mode, an offset is added to depth values of a polygon's + fragments before the depth comparison is performed. See + <code>glPolygonOffset</code>. + </td></tr> + <tr><td><code>GL_POLYGON_OFFSET_LINE</code> + </td><td>If enabled, and if the polygon is rendered in + <code>GL_LINE</code> mode, an offset is added to depth values of a polygon's + fragments before the depth comparison is performed. See <code>glPolygonOffset</code>. + </td></tr> + <tr><td><code>GL_POLYGON_OFFSET_POINT</code> + </td><td>If enabled, an offset is added to depth values of a polygon's fragments + before the depth comparison is performed, if the polygon is rendered in + <code>GL_POINT</code> mode. See +  + <code>glPolygonOffset</code>. + </td></tr> + <tr><td><code>GL_POLYGON_SMOOTH</code> + </td><td>If enabled, draw polygons with proper filtering. + Otherwise, draw aliased polygons. For correct anti-aliased polygons, + an alpha buffer is needed and the polygons must be sorted front to + back. + </td></tr> + <tr><td><code>GL_POLYGON_STIPPLE</code> + </td><td>If enabled, + use the current polygon stipple pattern when rendering + polygons. See <code>glPolygonStipple</code>. + </td></tr> + <tr><td><code>GL_SCISSOR_TEST</code> + </td><td>If enabled, + discard fragments that are outside the scissor rectangle. + See <code>glScissor</code>. + </td></tr> + <tr><td><code>GL_STENCIL_TEST</code> + </td><td>If enabled, + do stencil testing and update the stencil buffer. + See <code>glStencilFunc</code> and <code>glStencilOp</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_1D</code> + </td><td>If enabled, + one-dimensional texturing is performed + (unless two-dimensional texturing is also enabled). See <code>glTexImage1D</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_2D</code> + </td><td>If enabled, + two-dimensional texturing is performed. See <code>glTexImage2D</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_Q</code> + </td><td>If enabled, + the <i>q</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>q</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_R</code> + </td><td>If enabled, + the <i>r</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>r</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_S</code> + </td><td>If enabled, + the <i>s</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>s</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_GEN_T</code> + </td><td>If enabled, + the <i>t</i> texture coordinate is computed using + the texture generation function defined with <code>glTexGen</code>. + Otherwise, the current <i>t</i> texture coordinate is used. + See <code>glTexGen</code>. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating a GL capability.</p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating a GL capability.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>cap</i> is not one of the values + listed previously.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEnable</code> or <code>glDisable</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glEnableClientState</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEnableClientState</span>(</b><code class='datatype'>int</code> <code class='argument'>cap</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glEnableClientState</code> and <code>glDisableClientState</code> + enable or disable individual client-side capabilities. By default, all + client-side capabilities are disabled. + Both + <code>glEnableClientState</code> and <code>glDisableClientState</code> take a + single argument, <i>cap</i>, which can assume one of the following + values: </p> + <p><table class='box'> + <tr><td><code>GL_COLOR_ARRAY</code> + </td><td>If enabled, the color array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or + <code>glDrawElement</code> is called. See + <code>glColorPointer</code>. + </td></tr> + <tr><td><code>GL_EDGE_FLAG_ARRAY</code> + </td><td>If enabled, the edge flag array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is called. See + <code>glEdgeFlagPointer</code>. + </td></tr> + <tr><td><code>GL_INDEX_ARRAY</code> + </td><td>If enabled, the index array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or + <code>glDrawElements</code> is called. See + <code>glIndexPointer</code>. + </td></tr> + <tr><td><code>GL_NORMAL_ARRAY</code> + </td><td>If enabled, the normal array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is called. See + <code>glNormalPointer</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_COORD_ARRAY</code> + </td><td>If enabled, the texture coordinate array is enabled for writing and + used for rendering when <code>glDrawArrays</code> or <code>glDrawElements</code> is + called. See <code>glTexCoordPointer</code>. + </td></tr> + <tr><td><code>GL_VERTEX_ARRAY</code> + </td><td>If enabled, the vertex array is enabled for writing and used during + rendering when <code>glDrawArrays</code> or + <code>glDrawElements</code> is called. See + <code>glVertexPointer</code>. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the capability to enable. + Symbolic constants + <code>GL_COLOR_ARRAY</code>, + <code>GL_EDGE_FLAG_ARRAY</code>, + <code>GL_INDEX_ARRAY</code>, + <code>GL_NORMAL_ARRAY</code>, + <code>GL_TEXTURE_COORD_ARRAY</code>, and + <code>GL_VERTEX_ARRAY</code> + are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the capability to disable.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>cap</i> is not an accepted value.</p> + <p><code>glEnableClientState</code> is not allowed between the execution of <code>glBegin</code> and the + corresponding <code>glEnd</code>, but an error may or may not be generated. If + no error is generated, the behavior is undefined.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glEnd</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEnd</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glBegin</code> and <code>glEnd</code> delimit the vertices that define a primitive or + a group of like primitives. + <code>glBegin</code> accepts a single argument that specifies in which of ten ways the + vertices are interpreted. + Taking <i>n</i> as an integer count starting at one, + and <i>N</i> as the total number of vertices specified, + the interpretations are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_POINTS</code> + </td><td>Treats each vertex as a single point. + Vertex <i>n</i> defines point <i>n</i>. + <i>N</i> points are drawn. + </td></tr> + <tr><td><code>GL_LINES</code> + </td><td>Treats each pair of vertices as an independent line segment. + Vertices <i>2n-1</i> and <i>2n</i> define line <i>n</i>. + <i>N/2</i> lines are drawn. + </td></tr> + <tr><td><code>GL_LINE_STRIP</code> + </td><td>Draws a connected group of line segments from the first vertex + to the last. + Vertices <i>n</i> and <i>n+1</i> define line <i>n</i>. + <i>N-1</i> lines are drawn. + </td></tr> + <tr><td><code>GL_LINE_LOOP</code> + </td><td>Draws a connected group of line segments from the first vertex + to the last, + then back to the first. + Vertices <i>n</i> and <i>n+1</i> define line <i>n</i>. + The last line, however, is defined by vertices <i>N</i> and <i>1</i>. + <i>N</i> lines are drawn. + </td></tr> + <tr><td><code>GL_TRIANGLES</code> + </td><td>Treats each triplet of vertices as an independent triangle. + Vertices <i>3n-2</i>, + <i>3n-1</i>, + and <i>3n</i> define triangle <i>n</i>. + <i>N/3</i> triangles are drawn. + </td></tr> + <tr><td><code>GL_TRIANGLE_STRIP</code> + </td><td>Draws a connected group of triangles. + One triangle is defined for each vertex presented after the first two vertices. + For odd <i>n</i>, vertices <i>n</i>, + <i>n+1</i>, + and <i>n+2</i> define triangle <i>n</i>. + For even <i>n</i>, + vertices <i>n+1</i>, + <i>n</i>, + and <i>n+2</i> define triangle <i>n</i>. + <i>N-2</i> triangles are drawn. + </td></tr> + <tr><td><code>GL_TRIANGLE_FAN</code> + </td><td>Draws a connected group of triangles. + One triangle is defined for each vertex presented after the first two vertices. + Vertices <i>1</i>, + <i>n+1</i>, + and <i>n+2</i> define triangle <i>n</i>. + <i>N-2</i> triangles are drawn. + </td></tr> + <tr><td><code>GL_QUADS</code> + </td><td>Treats each group of four vertices as an independent quadrilateral. + Vertices <i>4n-3</i>, + <i>4n-2</i>, + <i>4n-1</i>, + and <i>4n</i> define quadrilateral <i>n</i>. + <i>N/4</i> quadrilaterals are drawn. + </td></tr> + <tr><td><code>GL_QUAD_STRIP</code> + </td><td>Draws a connected group of quadrilaterals. + One quadrilateral is defined for each pair of vertices presented + after the first pair. + Vertices <i>2n-1</i>, + <i>2n</i>, + <i>2n+2</i>, + and <i>2n+1</i> define quadrilateral <i>n</i>. + <i>N/2-1</i> quadrilaterals are drawn. + Note that the order in which vertices are used to construct a quadrilateral + from strip data is different from that used with independent data. + </td></tr> + <tr><td><code>GL_POLYGON</code> + </td><td>Draws a single, + convex polygon. + Vertices <i>1</i> through <i>N</i> define this polygon. + </td></tr> + </table> + </p> + <p>Only a subset of GL commands can be used between <code>glBegin</code> and <code>glEnd</code>. + The commands are + <code>glVertex</code>, + <code>glColor</code>, + <code>glIndex</code>, + <code>glNormal</code>, + <code>glTexCoord</code>, + <code>glEvalCoord</code>, + <code>glEvalPoint</code>, + <code>glArrayElement</code>, + <code>glMaterial</code>, and + <code>glEdgeFlag</code>. + Also, + it is acceptable to use + <code>glCallList</code> or + <code>glCallLists</code> to execute + display lists that include only the preceding commands. + If any other GL command is executed between <code>glBegin</code> and <code>glEnd</code>, + the error flag is set and the command is ignored.</p> + <p>Regardless of the value chosen for <i>mode</i>, + there is no limit to the number of vertices that can be defined + between <code>glBegin</code> and <code>glEnd</code>. + Lines, + triangles, + quadrilaterals, + and polygons that are incompletely specified are not drawn. + Incomplete specification results when either too few vertices are + provided to specify even a single primitive or when an incorrect multiple + of vertices is specified. The incomplete primitive is ignored; the rest are drawn.</p> + <p>The minimum specification of vertices + for each primitive is as follows: + 1 for a point, + 2 for a line, + 3 for a triangle, + 4 for a quadrilateral, + and 3 for a polygon. + Modes that require a certain multiple of vertices are + <code>GL_LINES</code> (2), + <code>GL_TRIANGLES</code> (3), + <code>GL_QUADS</code> (4), + and <code>GL_QUAD_STRIP</code> (2).</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the primitive or primitives that will be created from vertices + presented between <code>glBegin</code> and the subsequent <code>glEnd</code>. + Ten symbolic constants are accepted: + <code>GL_POINTS</code>, + <code>GL_LINES</code>, + <code>GL_LINE_STRIP</code>, + <code>GL_LINE_LOOP</code>, + <code>GL_TRIANGLES</code>, + <code>GL_TRIANGLE_STRIP</code>, + <code>GL_TRIANGLE_FAN</code>, + <code>GL_QUADS</code>, + <code>GL_QUAD_STRIP</code>, and + <code>GL_POLYGON</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is set to an unaccepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glBegin</code> is executed between a + <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEnd</code> is executed without being + preceded by a <code>glBegin</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if a command other than + <code>glVertex</code>, + <code>glColor</code>, + <code>glIndex</code>, + <code>glNormal</code>, + <code>glTexCoord</code>, + <code>glEvalCoord</code>, + <code>glEvalPoint</code>, + <code>glArrayElement</code>, + <code>glMaterial</code>, + <code>glEdgeFlag</code>, + <code>glCallList</code>, or + <code>glCallLists</code> is executed between + the execution of <code>glBegin</code> and the corresponding + execution <code>glEnd</code>.</p> + <p>Execution of + <code>glEnableClientState</code>, + <code>glDisableClientState</code>, + <code>glEdgeFlagPointer</code>, + <code>glTexCoordPointer</code>, + <code>glColorPointer</code>, + <code>glIndexPointer</code>, + <code>glNormalPointer</code>,</p> + <p><code>glVertexPointer</code>, + <code>glInterleavedArrays</code>, or + <code>glPixelStore</code> is not allowed after a call to <code>glBegin</code> and before + the corresponding call to <code>glEnd</code>, + but an error may or may not be generated.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glEndList</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEndList</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Display lists are groups of GL commands that have been stored + for subsequent execution. + Display lists are created with <code>glNewList</code>. + All subsequent commands are placed in the display list, + in the order issued, + until <code>glEndList</code> is called. </p> + <p><code>glNewList</code> has two arguments. + The first argument, + <i>list</i>, + is a positive integer that becomes the unique name for the display list. + Names can be created and reserved with <code>glGenLists</code> + and tested for uniqueness with <code>glIsList</code>. + The second argument, + <i>mode</i>, + is a symbolic constant that can assume one of two values: </p> + <p><table class='box'> + <tr><td><code>GL_COMPILE</code> + </td><td>Commands are merely compiled. + </td></tr> + <tr><td><code>GL_COMPILE_AND_EXECUTE</code> + </td><td>Commands are executed as they are compiled into the display list. + </td></tr> + </table> + </p> + <p>Certain commands are not compiled into the display list + but are executed immediately, + regardless of the display-list mode. + These commands are + <code>glColorPointer</code>, + <code>glDeleteLists</code>, + <code>glDisableClientState</code>, + <code>glEdgeFlagPointer</code>, + <code>glEnableClientState</code>, + <code>glFeedbackBuffer</code>, + <code>glFinish</code>, + <code>glFlush</code>, + <code>glGenLists</code>, + <code>glIndexPointer</code>, + <code>glInterleavedArrays</code>, + <code>glIsEnabled</code>, + <code>glIsList</code>, + <code>glNormalPointer</code>, + <code>glPopClientAttrib</code>, + <code>glPixelStore</code>, + <code>glPushClientAttrib</code>, + <code>glReadPixels</code>, + <code>glRenderMode</code>, + <code>glSelectBuffer</code>, + <code>glTexCoordPointer</code>, + <code>glVertexPointer</code>, + and all of the <code>glGet</code> commands.</p> + <p>Similarly, + <code>glTexImage2D</code> and <code>glTexImage1D</code> + are executed immediately and not compiled into the display list when their + first argument is <code>GL_PROXY_TEXTURE_2D</code> or + <code>GL_PROXY_TEXTURE_1D</code>, respectively.</p> + <p>When <code>glEndList</code> is encountered, + the display-list definition is completed by associating the list + with the unique name <i>list</i> + (specified in the <code>glNewList</code> command). + If a display list with name <i>list</i> already exists, + it is replaced only when <code>glEndList</code> is called.</p> + </dd> + <dt class='head--doc'><span id='p-list'></span>Parameter <code class='parameter'>list</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the display-list name.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the compilation mode, + which can be + <code>GL_COMPILE</code> or + <code>GL_COMPILE_AND_EXECUTE</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>list</i> is 0.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEndList</code> is called + without a preceding <code>glNewList</code>, + or if <code>glNewList</code> is called while a display list is being defined.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glNewList</code> or <code>glEndList</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + <p><code>GL_OUT_OF_MEMORY</code> is generated if there is insufficient memory to + compile the display list. If the GL version is 1.1 or greater, no + change is made to the previous contents of the display list, if any, + and no other change is made to the GL state. (It is as if no attempt + had been made to create the new display list.)</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glEvalCoord</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEvalCoord</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>u</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>v</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glEvalCoord1</code> evaluates enabled one-dimensional maps at argument + <i>u</i>. + <code>glEvalCoord2</code> does the same for two-dimensional maps using + two domain values, + <i>u</i> and <i>v</i>. + To define a map, call <code>glMap1</code> and <code>glMap2</code>; to enable and + disable it, call <code>glEnable</code> and <code>glDisable</code>.</p> + <p>When one of the <code>glEvalCoord</code> commands is issued, + all currently enabled maps of the indicated dimension are evaluated. + Then, + for each enabled map, + it is as if the corresponding GL command had been issued with the + computed value. + That is, + if <code>GL_MAP1_INDEX</code> or + <code>GL_MAP2_INDEX</code> is enabled, + a <code>glIndex</code> command is simulated. + If <code>GL_MAP1_COLOR_4</code> or + <code>GL_MAP2_COLOR_4</code> is enabled, + a <code>glColor</code> command is simulated. + If <code>GL_MAP1_NORMAL</code> or <code>GL_MAP2_NORMAL</code> is enabled, + a normal vector is produced, + and if any of + <code>GL_MAP1_TEXTURE_COORD_1</code>, + <code>GL_MAP1_TEXTURE_COORD_2</code>, + <code>GL_MAP1_TEXTURE_COORD_3</code>, + <code>GL_MAP1_TEXTURE_COORD_4</code>, + <code>GL_MAP2_TEXTURE_COORD_1</code>, + <code>GL_MAP2_TEXTURE_COORD_2</code>, + <code>GL_MAP2_TEXTURE_COORD_3</code>, or + <code>GL_MAP2_TEXTURE_COORD_4</code> is enabled, then an appropriate <code>glTexCoord</code> command is simulated.</p> + <p>For color, + color index, + normal, + and texture coordinates the GL uses evaluated values instead of current values for those evaluations + that are enabled, + and current values otherwise, + However, + the evaluated values do not update the current values. + Thus, if <code>glVertex</code> commands are interspersed with <code>glEvalCoord</code> + commands, the color, + normal, + and texture coordinates associated with the <code>glVertex</code> commands are not + affected by the values generated by the <code>glEvalCoord</code> commands, + but only by the most recent + <code>glColor</code>, + <code>glIndex</code>, + <code>glNormal</code>, and + <code>glTexCoord</code> commands.</p> + <p>No commands are issued for maps that are not enabled. + If more than one texture evaluation is enabled for a particular dimension + (for example, <code>GL_MAP2_TEXTURE_COORD_1</code> and + <code>GL_MAP2_TEXTURE_COORD_2</code>), + then only the evaluation of the map that produces the larger + number of coordinates + (in this case, <code>GL_MAP2_TEXTURE_COORD_2</code>) + is carried out. + <code>GL_MAP1_VERTEX_4</code> overrides <code>GL_MAP1_VERTEX_3</code>, + and + <code>GL_MAP2_VERTEX_4</code> overrides <code>GL_MAP2_VERTEX_3</code>, + in the same manner. + If neither a three- nor a four-component vertex map is enabled for the + specified dimension, + the <code>glEvalCoord</code> command is ignored.</p> + <p>If you have enabled automatic normal generation, + by calling <code>glEnable</code> with argument <code>GL_AUTO_NORMAL</code>, + <code>glEvalCoord2</code> generates surface normals analytically, + regardless of the contents or enabling of the <code>GL_MAP2_NORMAL</code> map. + Let + .sp + .nf +  Pp Pp + m = -- X -- +  Pu Pv + .sp + .fi</p> + <p>Then the generated normal n is </p> + <p>n = m over ~ over { || m || }</p> + <p>.sp</p> + <p>If automatic normal generation is disabled, + the corresponding normal map <code>GL_MAP2_NORMAL</code>, + if enabled, + is used to produce a normal. + If neither automatic normal generation nor a normal map is enabled, + no normal is generated for + <code>glEvalCoord2</code> commands.</p> + </dd> + <dt class='head--doc'><span id='p-u'></span>Parameter <code class='parameter'>u</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a value that is the domain coordinate u to the basis function + defined in a previous <code>glMap1</code> or <code>glMap2</code> command.</p> + </dd> + <dt class='head--doc'><span id='p-v'></span>Parameter <code class='parameter'>v</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a value that is the domain coordinate v to the basis function + defined in a previous <code>glMap2</code> command. + This argument is not present in a <code>glEvalCoord1</code> command.</p> + </dd> + <dt class='head--doc'><span id='p-u'></span>Parameter <code class='parameter'>u</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array containing + either one or two domain coordinates. + The first coordinate is u. + The second coordinate is v, + which is present only in <code>glEvalCoord2</code> versions.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glEvalPoint</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glEvalPoint</span>(</b><code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>int</code>) <code class='argument'>i</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>j</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glMapGrid</code> and <code>glEvalMesh</code> are used in tandem to efficiently + generate and evaluate a series of evenly spaced map domain values. + <code>glEvalPoint</code> can be used to evaluate a single grid point in the same gridspace + that is traversed by <code>glEvalMesh</code>. + Calling <code>glEvalPoint1</code> is equivalent to calling + .nf</p> + <p>glEvalCoord1(i . DELTA u + u ); +  1 + where </p> + <p>DELTA u = (u - u ) / n +  2 1 </p> + <p>and n, u , and u +  1 2</p> + <p>.fi + are the arguments to the most recent <code>glMapGrid1</code> command. + The one absolute numeric requirement is that if i~=~n, + then the value computed from + .nf + i . DELTA u + u is exactly u . +  1 2</p> + <p>.fi</p> + <p>In the two-dimensional case, + <code>glEvalPoint2</code>, + let + .nf + DELTA u = (u - u )/n +  2 1</p> + <p>DELTA v = (v - v )/m +  2 1</p> + <p>where n, u , u , m, v , and v +  1 2 1 2</p> + <p>.fi + are the arguments to the most recent <code>glMapGrid2</code> command. + Then the <code>glEvalPoint2</code> command is equivalent to calling + .nf</p> + <p>glEvalCoord2(i . DELTA u + u , j . DELTA v + v ); +  1 1</p> + <p>.fi + The only absolute numeric requirements are that if i~=~n, + then the value computed from + .nf</p> + <p>i . DELTA u + u is exactly u , +  1 2 + .fi + and if j~=~m, + then the value computed from + .nf</p> + <p>j cdot DELTA v + v is exactly v . +  1 2</p> + </dd> + <dt class='head--doc'><span id='p-i'></span>Parameter <code class='parameter'>i</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the integer value for grid domain variable i.</p> + </dd> + <dt class='head--doc'><span id='p-j'></span>Parameter <code class='parameter'>j</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the integer value for grid domain variable j + (<code>glEvalPoint2</code> only).</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glFinish</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glFinish</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glFinish</code> does not return until the effects of all previously + called GL commands are complete. + Such effects include all changes to GL state, + all changes to connection state, + and all changes to the frame buffer contents.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glFinish</code> is executed between + the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glFlush</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glFlush</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Different GL implementations buffer commands in several different locations, + including network buffers and the graphics accelerator itself. + <code>glFlush</code> empties all of these buffers, + causing all issued commands to be executed as quickly as + they are accepted by the actual rendering engine. + Though this execution may not be completed in any particular + time period, + it does complete in finite time.</p> + <p>Because any GL program might be executed over a network, + or on an accelerator that buffers commands, + all programs should call <code>glFlush</code> whenever they count on having + all of their previously issued commands completed. + For example, + call <code>glFlush</code> before waiting for user input that depends on + the generated image.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glFlush</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glFog</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glFog</span>(</b><code class='datatype'>int</code> <code class='argument'>pname</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>param</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Fog is initially disabled. + While enabled, fog affects rasterized geometry, + bitmaps, and pixel blocks, but not buffer clear operations. To enable + and disable fog, call <code>glEnable</code> and <code>glDisable</code> with argument + <code>GL_FOG</code>. </p> + <p><code>glFog</code> assigns the value or values in <i>params</i> to the fog parameter + specified by <i>pname</i>. + The following values are accepted for <i>pname</i>:</p> + <p><table class='box'> + <tr><td><code>GL_FOG_MODE</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + the equation to be used to compute the fog blend factor, f. + Three symbolic constants are accepted: + <code>GL_LINEAR</code>, + <code>GL_EXP</code>, + and <code>GL_EXP2</code>. + The equations corresponding to these symbolic constants are defined below. + The initial fog mode is <code>GL_EXP</code>. + </td></tr> + <tr><td><code>GL_FOG_DENSITY</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies density, + the fog density used in both exponential fog equations. + Only nonnegative densities are accepted. + The initial fog density is 1. + </td></tr> + <tr><td><code>GL_FOG_START</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies start, + the near distance used in the linear fog equation. + The initial near distance is 0. + </td></tr> + <tr><td><code>GL_FOG_END</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies end, + the far distance used in the linear fog equation. + The initial far distance is 1. + </td></tr> + <tr><td><code>GL_FOG_INDEX</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + i sub f, + the fog color index. + The initial fog index is 0. + </td></tr> + <tr><td><code>GL_FOG_COLOR</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + C sub f, the fog color. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + After conversion, + all color components are clamped to the range [0,1]. + The initial fog color is (0, 0, 0, 0). + </td></tr> + </table> + </p> + <p>Fog blends a fog color with each rasterized pixel fragment's posttexturing + color using a blending factor f. + Factor f is computed in one of three ways, + depending on the fog mode. + Let z be the distance in eye coordinates from the origin to the fragment + being fogged. + The equation for <code>GL_LINEAR</code> fog is + .ce</p> + <p>.EQ + f ~=~ {end ~-~ z} over {end ~-~ start} + .EN</p> + <p>.RE</p> + <p>The equation for <code>GL_EXP</code> fog is + .ce</p> + <p>.EQ + f ~=~ e ** (-(density ~cdot~ z)) + .EN</p> + <p>The equation for <code>GL_EXP2</code> fog is + .ce</p> + <p>.EQ + f ~=~ e ** (-(density ~cdot~ z) ** 2) + .EN</p> + <p>Regardless of the fog mode, + f is clamped to the range [0,1] after it is computed. + Then, + if the GL is in RGBA color mode, + the fragment's color C sub r is replaced by + .sp + .ce + .EQ + {C sub r} prime ~=~ f C sub r + (1 - f) C sub f + .EN</p> + <p>In color index mode, the fragment's color index i sub r is replaced by + .sp + .ce + .EQ + {i sub r} prime ~=~ i sub r + (1 - f) i sub f + .EN</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a single-valued fog parameter. + <code>GL_FOG_MODE</code>, + <code>GL_FOG_DENSITY</code>, + <code>GL_FOG_START</code>, + <code>GL_FOG_END</code>, + and + <code>GL_FOG_INDEX</code> + are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-param'></span>Parameter <code class='parameter'>param</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the value that <i>pname</i> will be set to.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a fog parameter. + <code>GL_FOG_MODE</code>, + <code>GL_FOG_DENSITY</code>, + <code>GL_FOG_START</code>, + <code>GL_FOG_END</code>, + <code>GL_FOG_INDEX</code>, + and + <code>GL_FOG_COLOR</code> + are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-params'></span>Parameter <code class='parameter'>params</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the value or values to be assigned to <i>pname</i>. + <code>GL_FOG_COLOR</code> requires an array of four values. + All other parameters accept an array containing only a single value.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>pname</i> is not an accepted value, + or if <i>pname</i> is <code>GL_FOG_MODE</code> and <i>params</i> is not an accepted value.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>pname</i> is <code>GL_FOG_DENSITY</code>, + and <i>params</i> is negative.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glFog</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glFrontFace</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glFrontFace</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>In a scene composed entirely of opaque closed surfaces, + back-facing polygons are never visible. + Eliminating these invisible polygons has the obvious benefit + of speeding up the rendering of the image. + To enable and disable elimination of back-facing polygons, call <code>glEnable</code> + and <code>glDisable</code> with argument <code>GL_CULL_FACE</code>.</p> + <p>The projection of a polygon to window coordinates is said to have + clockwise winding if an imaginary object following the path + from its first vertex, + its second vertex, + and so on, + to its last vertex, + and finally back to its first vertex, + moves in a clockwise direction about the interior of the polygon. + The polygon's winding is said to be counterclockwise if the imaginary + object following the same path moves in a counterclockwise direction + about the interior of the polygon. + <code>glFrontFace</code> specifies whether polygons with clockwise winding in window coordinates, + or counterclockwise winding in window coordinates, + are taken to be front-facing. + Passing <code>GL_CCW</code> to <i>mode</i> selects counterclockwise polygons as + front-facing; + <code>GL_CW</code> selects clockwise polygons as front-facing. + By default, counterclockwise polygons are taken to be front-facing.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the orientation of front-facing polygons. + <code>GL_CW</code> and <code>GL_CCW</code> are accepted. + The initial value is <code>GL_CCW</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glFrontFace</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glFrustum</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glFrustum</span>(</b><code class='datatype'>float</code> <code class='argument'>left</code>, <code class='datatype'>float</code> <code class='argument'>right</code>, <code class='datatype'>float</code> <code class='argument'>bottom</code>, <code class='datatype'>float</code> <code class='argument'>top</code>, <code class='datatype'>float</code> <code class='argument'>zNear</code>, <code class='datatype'>float</code> <code class='argument'>zFar</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glFrustum</code> describes a perspective matrix that produces a perspective projection. + The current matrix (see <code>glMatrixMode</code>) is multiplied by this matrix + and the result replaces the current matrix, as if + <code>glMultMatrix</code> were called with the following matrix + as its argument:</p> + <p>.sp 5 + .ce + .EQ + down 130 {left ( ~~ matrix { +  ccol { {{2 ~ "zNear"} over {"right" - "left"}} above 0 above 0 above 0 } +  ccol { 0 above {{2 ~ "zNear"} over {"top" - "bottom"}} ~ above 0 above 0 } +  ccol { A ~~~~ above B ~~~~ above C ~~~~ above -1 ~~~~} +  ccol { 0 above 0 above D above 0} + } ~~~ right )} + .EN + .sp + .ce + .EQ + down 130 + {A ~=~ {"right" + "left"} over {"right" - "left"}} + .EN + .sp + .ce + .EQ + down 130 + {B ~=~ {"top" + "bottom"} over {"top" - "bottom"}} + .EN + .sp + .ce + .EQ + down 130 + {C ~=~ -{{"zFar" + "zNear"} over {"zFar" - "zNear"}}} + .EN + .sp + .ce + .EQ + down 130 + {D ~=~ -{{2 ~ "zFar" ~ "zNear"} over {"zFar" - "zNear"}}} + .EN + .sp</p> + <p>Typically, the matrix mode is <code>GL_PROJECTION</code>, and + (<i>left</i>, <i>bottom</i>, -<i>zNear</i>) and (<i>right</i>, <i>top</i>, -<i>zNear</i>) + specify the points on the near clipping plane that are mapped + to the lower left and upper right corners of the window, + assuming that the eye is located at (0, 0, 0). + -<i>zFar</i> specifies the location of the far clipping plane. + Both <i>zNear</i> and <i>zFar</i> must be positive.</p> + <p>Use <code>glPushMatrix</code> and <code>glPopMatrix</code> to save and restore + the current matrix stack.</p> + </dd> + <dt class='head--doc'><span id='p-left'></span>Parameter <code class='parameter'>left</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the coordinates for the left and right vertical clipping planes.</p> + </dd> + <dt class='head--doc'><span id='p-bottom'></span>Parameter <code class='parameter'>bottom</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the coordinates for the bottom and top horizontal clipping planes.</p> + </dd> + <dt class='head--doc'><span id='p-zNear'></span>Parameter <code class='parameter'>zNear</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the distances to the near and far depth clipping planes. + Both distances must be positive.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>zNear</i> or <i>zFar</i> is not positive.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glFrustum</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glGenLists</b></span> + </dt> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>glGenLists</span>(</b><code class='datatype'>int</code> <code class='argument'>range</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glGenLists</code> has one argument, <i>range</i>. + It returns an integer <i>n</i> such that <i>range</i> contiguous + empty display lists, + named <i>n</i>, <i>n</i>+1, ..., <i>n</i>+<i>range</i> -1, + are created. + If <i>range</i> is 0, + if there is no group of <i>range</i> contiguous names available, + or if any error is generated, + no display lists are generated, + and 0 is returned.</p> + </dd> + <dt class='head--doc'><span id='p-range'></span>Parameter <code class='parameter'>range</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the number of contiguous empty display lists + to be generated.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>range</i> is negative.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glGenLists</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glGetError</b></span> + </dt> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>glGetError</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glGetError</code> returns the value of the error flag. + Each detectable error is assigned a numeric code and symbolic name. + When an error occurs, + the error flag is set to the appropriate error code value. + No other errors are recorded until <code>glGetError</code> is called, + the error code is returned, + and the flag is reset to <code>GL_NO_ERROR</code>. + If a call to <code>glGetError</code> returns <code>GL_NO_ERROR</code>, + there has been no detectable error since the last call to <code>glGetError</code>, + or since the GL was initialized.</p> + <p>To allow for distributed implementations, + there may be several error flags. + If any single error flag has recorded an error, + the value of that flag is returned + and that flag is reset to <code>GL_NO_ERROR</code> + when <code>glGetError</code> is called. + If more than one flag has recorded an error, + <code>glGetError</code> returns and clears an arbitrary error flag value. + Thus, <code>glGetError</code> should always be called in a loop, + until it returns <code>GL_NO_ERROR</code>, + if all error flags are to be reset.</p> + <p>Initially, all error flags are set to <code>GL_NO_ERROR</code>.</p> + <p>The following errors are currently defined:</p> + <p><table class='box'> + <tr><td><code>GL_NO_ERROR</code> + </td><td>No error has been recorded. + The value of this symbolic constant is guaranteed to be 0. + </td></tr> + <tr><td><code>GL_INVALID_ENUM</code> + </td><td>An unacceptable value is specified for an enumerated argument. + The offending command is ignored, + and has no other side effect than to set the error flag. + </td></tr> + <tr><td><code>GL_INVALID_VALUE</code> + </td><td>A numeric argument is out of range. + The offending command is ignored, + and has no other side effect than to set the error flag. + </td></tr> + <tr><td><code>GL_INVALID_OPERATION</code> + </td><td>The specified operation is not allowed in the current state. + The offending command is ignored, + and has no other side effect than to set the error flag. + </td></tr> + <tr><td><code>GL_STACK_OVERFLOW</code> + </td><td>This command would cause a stack overflow. + The offending command is ignored, + and has no other side effect than to set the error flag. + </td></tr> + <tr><td><code>GL_STACK_UNDERFLOW</code> + </td><td>This command would cause a stack underflow. + The offending command is ignored, + and has no other side effect than to set the error flag. + </td></tr> + <tr><td><code>GL_OUT_OF_MEMORY</code> + </td><td>There is not enough memory left to execute the command. + The state of the GL is undefined, + except for the state of the error flags, + after this error is recorded. + </td></tr> + </table> + </p> + <p>When an error flag is set, + results of a GL operation are undefined only if <code>GL_OUT_OF_MEMORY</code> + has occurred. + In all other cases, + the command generating the error is ignored and has no effect on the GL state + or frame buffer contents. + If the generating command returns a value, it returns 0. + If <code>glGetError</code> itself generates an error, it returns 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glGetError</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>. + In this case <code>glGetError</code> returns 0.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glGetString</b></span> + </dt> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>glGetString</span>(</b><code class='datatype'>int</code> <code class='argument'>name</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glGetString</code> returns a pointer to a static string + describing some aspect of the current GL connection. + <i>name</i> can be one of the following:</p> + <p><table class='box'> + <tr><td><code>GL_VENDOR</code> + </td><td>Returns the company responsible for this GL implementation. + This name does not change from release to release. + </td></tr> + <tr><td><code>GL_RENDERER</code> + </td><td>Returns the name of the renderer. + This name is typically specific to a particular configuration of a hardware + platform. + It does not change from release to release. + </td></tr> + <tr><td><code>GL_VERSION</code> + </td><td>Returns a version or release number. + </td></tr> + <tr><td><code>GL_EXTENSIONS</code> + </td><td>Returns a space-separated list of supported extensions to GL. + </td></tr> + </table> + </p> + <p>Because the GL does not include queries for the performance + characteristics of an implementation, some applications are written to + recognize known platforms and modify their GL usage based on known + performance characteristics of these platforms. + Strings <code>GL_VENDOR</code> and <code>GL_RENDERER</code> together uniquely specify + a platform. They do not change from release to release and should be used + by platform-recognition algorithms. </p> + <p>Some applications want to make use of features that + are not part of the standard GL. These features + may be implemented as extensions to the standard GL. + The <code>GL_EXTENSIONS</code> string is a space-separated + list of supported GL extensions. + (Extension names never contain a space character.)</p> + <p>The <code>GL_VERSION</code> string begins with a version number. + The version number uses one + of these forms: </p> + <p><i>major_number.minor_number</i> </p> + <p><i>major_number.minor_number.release_number</i></p> + <p>Vendor-specific information may follow the version + number. Its format depends on the implementation, but + a space always separates the version number and + the vendor-specific information.</p> + <p>All strings are null-terminated.</p> + </dd> + <dt class='head--doc'><span id='p-name'></span>Parameter <code class='parameter'>name</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant, one of + <code>GL_VENDOR</code>, <code>GL_RENDERER</code>, <code>GL_VERSION</code>, or <code>GL_EXTENSIONS</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>name</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glGetString</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glHint</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glHint</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Certain aspects of GL behavior, + when there is room for interpretation, + can be controlled with hints. + A hint is specified with two arguments. + <i>target</i> is a symbolic + constant indicating the behavior to be controlled, + and <i>mode</i> is another symbolic constant indicating the desired + behavior. The initial value for each <i>target</i> is <code>GL_DONT_CARE</code>. + <i>mode</i> can be one of the following:</p> + <p><table class='box'> + <tr><td><code>GL_FASTEST</code> + </td><td>The most efficient option should be chosen. + </td></tr> + <tr><td><code>GL_NICEST</code> + </td><td>The most correct, + or highest quality, + option should be chosen. + </td></tr> + <tr><td><code>GL_DONT_CARE</code> + </td><td>No preference. + </td></tr> + </table> + </p> + <p>Though the implementation aspects that can be hinted are well defined, + the interpretation of the hints depends on the implementation. + The hint aspects that can be specified with <i>target</i>, + along with suggested semantics, + are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_FOG_HINT</code> + </td><td>Indicates the accuracy of fog calculation. + If per-pixel fog calculation is not efficiently supported + by the GL implementation, + hinting <code>GL_DONT_CARE</code> or <code>GL_FASTEST</code> can result in per-vertex + calculation of fog effects. + </td></tr> + <tr><td><code>GL_LINE_SMOOTH_HINT</code> + </td><td>Indicates the sampling quality of antialiased lines. + If a larger filter function is applied, hinting <code>GL_NICEST</code> can + result in more pixel fragments being generated during rasterization, + </td></tr> + <tr><td><code>GL_PERSPECTIVE_CORRECTION_HINT</code> + </td><td>Indicates the quality of color and texture coordinate interpolation. + If perspective-corrected parameter interpolation is not efficiently supported + by the GL implementation, + hinting <code>GL_DONT_CARE</code> or <code>GL_FASTEST</code> can result in simple linear + interpolation of colors and/or texture coordinates. + </td></tr> + <tr><td><code>GL_POINT_SMOOTH_HINT</code> + </td><td>Indicates the sampling quality of antialiased points. + If a larger filter function is applied, hinting <code>GL_NICEST</code> can + result in more pixel fragments being generated during rasterization, + </td></tr> + <tr><td><code>GL_POLYGON_SMOOTH_HINT</code> + </td><td>Indicates the sampling quality of antialiased polygons. + Hinting <code>GL_NICEST</code> can result in more pixel fragments being generated + during rasterization, + if a larger filter function is applied. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating the behavior to be controlled. + <code>GL_FOG_HINT</code>, + <code>GL_LINE_SMOOTH_HINT</code>, + <code>GL_PERSPECTIVE_CORRECTION_HINT</code>, + <code>GL_POINT_SMOOTH_HINT</code>, and + <code>GL_POLYGON_SMOOTH_HINT</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating the desired behavior. + <code>GL_FASTEST</code>, + <code>GL_NICEST</code>, and + <code>GL_DONT_CARE</code> are accepted.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if either <i>target</i> or <i>mode</i> is not + an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glHint</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glIndex</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glIndex</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code> <code class='argument'>c</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glIndex</code> updates the current (single-valued) color index. + It takes one argument, the new value for the current color index.</p> + <p>The current index is stored as a floating-point value. + Integer values are converted directly to floating-point values, + with no special mapping. + The initial value is 1. </p> + <p>Index values outside the representable range of the color index buffer + are not clamped. + However, + before an index is dithered (if enabled) and written to the frame buffer, + it is converted to fixed-point format. + Any bits in the integer portion of the resulting fixed-point value + that do not correspond to bits in the frame buffer are masked out.</p> + </dd> + <dt class='head--doc'><span id='p-c'></span>Parameter <code class='parameter'>c</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the new value for the current color index.</p> + </dd> + <dt class='head--doc'><span id='p-c'></span>Parameter <code class='parameter'>c</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to a one-element array that contains + the new value for the current color index.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glIndexMask</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glIndexMask</span>(</b><code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glIndexMask</code> controls the writing of individual bits in the color index buffers. + The least significant n bits of <i>mask</i>, + where n is the number of bits in a color index buffer, + specify a mask. + Where a 1 (one) appears in the mask, + it's possible to write to the corresponding bit in the color index + buffer (or buffers). + Where a 0 (zero) appears, + the corresponding bit is write-protected.</p> + <p>This mask is used only in color index mode, + and it affects only the buffers currently selected for writing + (see <code>glDrawBuffer</code>). + Initially, all bits are enabled for writing.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a bit mask to enable and disable the writing of individual bits + in the color index buffers. + Initially, the mask is all 1's.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glIndexMask</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glInitNames</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glInitNames</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The name stack is used during selection mode to allow sets of rendering + commands to be uniquely identified. + It consists of an ordered set of unsigned integers. + <code>glInitNames</code> causes the name stack to be initialized to its default empty state.</p> + <p>The name stack is always empty while the render mode is not <code>GL_SELECT</code>. + Calls to <code>glInitNames</code> while the render mode is not <code>GL_SELECT</code> are ignored.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glInitNames</code> + is executed between the execution of <code>glBegin</code> and the corresponding execution of + <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glIsEnabled</b></span> + </dt> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>glIsEnabled</span>(</b><code class='datatype'>int</code> <code class='argument'>cap</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glIsEnabled</code> returns <code>GL_TRUE</code> if <i>cap</i> is an enabled capability + and returns <code>GL_FALSE</code> otherwise. + Initially all capabilities except <code>GL_DITHER</code> are disabled; + <code>GL_DITHER</code> is initially enabled.</p> + <p>The following capabilities are accepted for <i>cap</i>:</p> + <p>.TS + lb lb + l l l. + Constant See + _</p> + <p><code>GL_ALPHA_TEST</code> <code>glAlphaFunc</code> + <code>GL_AUTO_NORMAL</code> <code>glEvalCoord</code> + <code>GL_BLEND</code> <code>glBlendFunc</code>, <code>glLogicOp</code> + <code>GL_CLIP_PLANE</code><i>i</i> <code>glClipPlane</code> + <code>GL_COLOR_ARRAY</code> <code>glColorPointer</code> + <code>GL_COLOR_LOGIC_OP</code> <code>glLogicOp</code> + <code>GL_COLOR_MATERIAL</code> <code>glColorMaterial</code> + <code>GL_CULL_FACE</code> <code>glCullFace</code> + <code>GL_DEPTH_TEST</code> <code>glDepthFunc</code>, <code>glDepthRange</code> + <code>GL_DITHER</code> <code>glEnable</code> + <code>GL_EDGE_FLAG_ARRAY</code> <code>glEdgeFlagPointer</code> + <code>GL_FOG</code> <code>glFog</code> + <code>GL_INDEX_ARRAY</code> <code>glIndexPointer</code> + <code>GL_INDEX_LOGIC_OP</code> <code>glLogicOp</code> + <code>GL_LIGHT</code><i>i</i> <code>glLightModel</code>, <code>glLight</code> + <code>GL_LIGHTING</code> <code>glMaterial</code>, <code>glLightModel</code>, <code>glLight</code> + <code>GL_LINE_SMOOTH</code> <code>glLineWidth</code> + <code>GL_LINE_STIPPLE</code> <code>glLineStipple</code> + <code>GL_MAP1_COLOR_4</code> <code>glMap1</code>, <code>glMap2</code> + <code>GL_MAP2_TEXTURE_COORD_2</code> <code>glMap2</code> + <code>GL_MAP2_TEXTURE_COORD_3</code> <code>glMap2</code> + <code>GL_MAP2_TEXTURE_COORD_4</code> <code>glMap2</code> + <code>GL_MAP2_VERTEX_3</code> <code>glMap2</code> + <code>GL_MAP2_VERTEX_4</code> <code>glMap2</code> + <code>GL_NORMAL_ARRAY</code> <code>glNormalPointer</code> + <code>GL_NORMALIZE</code> <code>glNormal</code> + <code>GL_POINT_SMOOTH</code> <code>glPointSize</code> + <code>GL_POLYGON_SMOOTH</code> <code>glPolygonMode</code> + <code>GL_POLYGON_OFFSET_FILL</code> <code>glPolygonOffset</code> + <code>GL_POLYGON_OFFSET_LINE</code> <code>glPolygonOffset</code> + <code>GL_POLYGON_OFFSET_POINT</code> <code>glPolygonOffset</code> + <code>GL_POLYGON_STIPPLE</code> <code>glPolygonStipple</code> + <code>GL_SCISSOR_TEST</code> <code>glScissor</code> + <code>GL_STENCIL_TEST</code> <code>glStencilFunc</code>, <code>glStencilOp</code> + <code>GL_TEXTURE_1D</code> <code>glTexImage1D</code> + <code>GL_TEXTURE_2D</code> <code>glTexImage2D</code> + <code>GL_TEXTURE_COORD_ARRAY</code> <code>glTexCoordPointer</code> + <code>GL_TEXTURE_GEN_Q</code> <code>glTexGen</code> + <code>GL_TEXTURE_GEN_R</code> <code>glTexGen</code> + <code>GL_TEXTURE_GEN_S</code> <code>glTexGen</code> + <code>GL_TEXTURE_GEN_T</code> <code>glTexGen</code> + <code>GL_VERTEX_ARRAY</code> <code>glVertexPointer</code> + .TE</p> + </dd> + <dt class='head--doc'><span id='p-cap'></span>Parameter <code class='parameter'>cap</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant indicating a GL capability.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>cap</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glIsEnabled</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glIsList</b></span> + </dt> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>glIsList</span>(</b><code class='datatype'>int</code> <code class='argument'>list</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glIsList</code> returns <code>GL_TRUE</code> if <i>list</i> is the name + of a display list and returns <code>GL_FALSE</code> otherwise.</p> + </dd> + <dt class='head--doc'><span id='p-list'></span>Parameter <code class='parameter'>list</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a potential display-list name.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glIsList</code> + is executed between the execution of + <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glIsTexture</b></span> + </dt> + <dd><p><code><code class='datatype'>int</code> <b><span class='method'>glIsTexture</span>(</b><code class='datatype'>int</code> <code class='argument'>texture</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glIsTexture</code> returns <code>GL_TRUE</code> if <i>texture</i> is currently the name of a texture. + If <i>texture</i> is zero, or is a non-zero value that is not currently the + name of a texture, or if an error occurs, <code>glIsTexture</code> returns <code>GL_FALSE</code>.</p> + </dd> + <dt class='head--doc'><span id='p-texture'></span>Parameter <code class='parameter'>texture</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a value that may be the name of a texture.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glIsTexture</code> is executed + between the execution of <code>glBegin</code> and the corresponding + execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLight</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLight</span>(</b><code class='datatype'>int</code> <code class='argument'>light</code>, <code class='datatype'>int</code> <code class='argument'>pname</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>param</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glLight</code> sets the values of individual light source parameters. + <i>light</i> names the light and is a symbolic name of the form <code>GL_LIGHT</code>i, + where 0 \(&lt;= i &lt; <code>GL_MAX_LIGHTS</code>. + <i>pname</i> specifies one of ten light source parameters, + again by symbolic name. + <i>params</i> is either a single value or a pointer to an array that contains + the new values.</p> + <p>To enable and disable lighting calculation, call <code>glEnable</code> + and <code>glDisable</code> with argument <code>GL_LIGHTING</code>. Lighting is + initially disabled. + When it is enabled, + light sources that are enabled contribute to the lighting calculation. + Light source i is enabled and disabled using <code>glEnable</code> and + <code>glDisable</code> with argument <code>GL_LIGHT</code>i. </p> + <p>The ten light parameters are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_AMBIENT</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the ambient RGBA intensity of the light. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial ambient light intensity is (0, 0, 0, 1). + </td></tr> + <tr><td><code>GL_DIFFUSE</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the diffuse RGBA intensity of the light. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial value + for <code>GL_LIGHT0</code> is (1, 1, 1, 1); for other lights, the + initial value is (0, 0, 0, 0). + </td></tr> + <tr><td><code>GL_SPECULAR</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the specular RGBA intensity of the light. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial value + for <code>GL_LIGHT0</code> is (1, 1, 1, 1); for other lights, the + initial value is (0, 0, 0, 0). + </td></tr> + <tr><td><code>GL_POSITION</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the position of the light in homogeneous object coordinates. + Both integer and floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. +  + The position is transformed by the modelview matrix when + <code>glLight</code> is called (just as if it were a point), + and it is stored in eye coordinates. + If the w component of the position is 0, + the light is treated as a directional source. + Diffuse and specular lighting calculations take the light's direction, + but not its actual position, + into account, + and attenuation is disabled. + Otherwise, + diffuse and specular lighting calculations are based on the actual location + of the light in eye coordinates, + and attenuation is enabled. + The initial position is (0, 0, 1, 0); + thus, the initial light source is directional, + parallel to, and in the direction of the -z axis. + </td></tr> + <tr><td><code>GL_SPOT_DIRECTION</code> + </td><td><i>params</i> contains three integer or floating-point values that specify + the direction of the light in homogeneous object coordinates. + Both integer and floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. +  + The spot direction is transformed by the inverse of the modelview matrix when + <code>glLight</code> is called (just as if it were a normal), + and it is stored in eye coordinates. + It is significant only when <code>GL_SPOT_CUTOFF</code> is not 180, + which it is initially. + The initial direction is (0, 0, -1). + </td></tr> + <tr><td><code>GL_SPOT_EXPONENT</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + the intensity distribution of the light. + Integer and floating-point values are mapped directly. + Only values in the range [0,128] are accepted. +  + Effective light intensity is attenuated by the cosine of the angle between + the direction of the light and the direction from the light to the vertex + being lighted, + raised to the power of the spot exponent. + Thus, higher spot exponents result in a more focused light source, + regardless of the spot cutoff angle (see <code>GL_SPOT_CUTOFF</code>, next paragraph). + The initial spot exponent is 0, + resulting in uniform light distribution. + </td></tr> + <tr><td><code>GL_SPOT_CUTOFF</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + the maximum spread angle of a light source. + Integer and floating-point values are mapped directly. + Only values in the range [0,90] and the special value 180 + are accepted. + If the angle between the direction of the light and the direction from the + light to the vertex being lighted is greater than the spot cutoff angle, + the light is completely masked. + Otherwise, its intensity is controlled by the spot exponent and the + attenuation factors. + The initial spot cutoff is 180, + resulting in uniform light distribution. + </td></tr> + <tr><td><code>GL_CONSTANT_ATTENUATION</code> + </td><td></td></tr> + <tr><td><code>GL_LINEAR_ATTENUATION </code> + </td><td></td></tr> + <tr><td><code>GL_QUADRATIC_ATTENUATION</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + one of the three light attenuation factors. + Integer and floating-point values are mapped directly. + Only nonnegative values are accepted. + If the light is positional, + rather than directional, + its intensity is attenuated by the reciprocal of the sum of the constant + factor, the linear factor times the distance between the light + and the vertex being lighted, + and the quadratic factor times the square of the same distance. + The initial attenuation factors are (1, 0, 0), + resulting in no attenuation. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-light'></span>Parameter <code class='parameter'>light</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a light. + The number of lights depends on the implementation, + but at least eight lights are supported. + They are identified by symbolic names of the form <code>GL_LIGHT</code>i + where 0 \(&lt;= i &lt; <code>GL_MAX_LIGHTS</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a single-valued light source parameter for <i>light</i>. + <code>GL_SPOT_EXPONENT</code>, + <code>GL_SPOT_CUTOFF</code>, + <code>GL_CONSTANT_ATTENUATION</code>, + <code>GL_LINEAR_ATTENUATION</code>, and + <code>GL_QUADRATIC_ATTENUATION</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-param'></span>Parameter <code class='parameter'>param</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the value that parameter <i>pname</i> of light source <i>light</i> + will be set to.</p> + </dd> + <dt class='head--doc'><span id='p-light'></span>Parameter <code class='parameter'>light</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a light. + The number of lights depends on the implementation, but + at least eight lights are supported. + They are identified by symbolic names of the form <code>GL_LIGHT</code>i + where 0 \(&lt;= i &lt; <code>GL_MAX_LIGHTS</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a light source parameter for <i>light</i>. + <code>GL_AMBIENT</code>, + <code>GL_DIFFUSE</code>, + <code>GL_SPECULAR</code>, + <code>GL_POSITION</code>, + <code>GL_SPOT_CUTOFF</code>, + <code>GL_SPOT_DIRECTION</code>, + <code>GL_SPOT_EXPONENT</code>, + <code>GL_CONSTANT_ATTENUATION</code>, + <code>GL_LINEAR_ATTENUATION</code>, and + <code>GL_QUADRATIC_ATTENUATION</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-params'></span>Parameter <code class='parameter'>params</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to the value or values that parameter <i>pname</i> + of light source <i>light</i> will be set to.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if either <i>light</i> or <i>pname</i> + is not an accepted value.</p> + <p><code>GL_INVALID_VALUE</code> is generated if a spot exponent value is specified + outside the range [0,128], + or if spot cutoff is specified outside the range [0,90] (except for the + special value 180), + or if a negative attenuation factor is specified.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glLight</code> is executed between + the execution of + <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLightModel</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLightModel</span>(</b><code class='datatype'>int</code> <code class='argument'>pname</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>param</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glLightModel</code> sets the lighting model parameter. + <i>pname</i> names a parameter and <i>params</i> gives the new value. + There are three lighting model parameters:</p> + <p><table class='box'> + <tr><td><code>GL_LIGHT_MODEL_AMBIENT</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the ambient RGBA intensity of the entire scene. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial ambient scene intensity is (0.2, 0.2, 0.2, 1.0). + </td></tr> + <tr><td><code>GL_LIGHT_MODEL_LOCAL_VIEWER</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + how specular reflection angles are computed. + If <i>params</i> is 0 (or 0.0), specular reflection angles take the + view direction to be parallel to and in the direction of the -<i>z</i> axis, + regardless of the location of the vertex in eye coordinates. + Otherwise, specular reflections are computed from the origin + of the eye coordinate system. + The initial value is 0. + </td></tr> + <tr><td><code>GL_LIGHT_MODEL_TWO_SIDE</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + whether one- or two-sided lighting calculations are done for polygons. + It has no effect on the lighting calculations for points, + lines, + or bitmaps. + If <i>params</i> is 0 (or 0.0), one-sided lighting is specified, + and only the <i>front</i> material parameters are used in the + lighting equation. + Otherwise, two-sided lighting is specified. + In this case, vertices of back-facing polygons are lighted using the + <i>back</i> material parameters, + and have their normals reversed before the lighting equation is evaluated. + Vertices of front-facing polygons are always lighted using the + <i>front</i> material parameters, + with no change to their normals. The initial value is 0. + </td></tr> + </table> + </p> + <p>In RGBA mode, the lighted color of a vertex is the sum of + the material emission intensity, + the product of the material ambient reflectance and the lighting model full-scene + ambient intensity, + and the contribution of each enabled light source. + Each light source contributes the sum of three terms: + ambient, diffuse, and specular. + The ambient light source contribution is the product of the material ambient + reflectance and the light's ambient intensity. + The diffuse light source contribution is the product of the material diffuse + reflectance, + the light's diffuse intensity, + and the dot product of the vertex's normal with the normalized vector from + the vertex to the light source. + The specular light source contribution is the product of the material specular + reflectance, + the light's specular intensity, + and the dot product of the normalized vertex-to-eye and vertex-to-light + vectors, + raised to the power of the shininess of the material. + All three light source contributions are attenuated equally based on + the distance from the vertex to the light source and on light source + direction, spread exponent, and spread cutoff angle. + All dot products are replaced with 0 if they evaluate to a negative value.</p> + <p>The alpha component of the resulting lighted color is set to the alpha value + of the material diffuse reflectance.</p> + <p>In color index mode, + the value of the lighted index of a vertex ranges from the ambient + to the specular values passed to <code>glMaterial</code> using <code>GL_COLOR_INDEXES</code>. + Diffuse and specular coefficients, + computed with a (.30, .59, .11) weighting of the lights' colors, + the shininess of the material, + and the same reflection and attenuation equations as in the RGBA case, + determine how much above ambient the resulting index is.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a single-valued lighting model parameter. + <code>GL_LIGHT_MODEL_LOCAL_VIEWER</code> and + <code>GL_LIGHT_MODEL_TWO_SIDE</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-param'></span>Parameter <code class='parameter'>param</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the value that <i>param</i> will be set to.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a lighting model parameter. + <code>GL_LIGHT_MODEL_AMBIENT</code>, + <code>GL_LIGHT_MODEL_LOCAL_VIEWER</code>, and + <code>GL_LIGHT_MODEL_TWO_SIDE</code> are accepted.</p> + </dd> + <dt class='head--doc'><span id='p-params'></span>Parameter <code class='parameter'>params</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to the value or values that <i>params</i> will be set to.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>pname</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glLightModel</code> is executed between + the execution of <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLineStipple</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLineStipple</span>(</b><code class='datatype'>int</code> <code class='argument'>factor</code>, <code class='datatype'>int</code> <code class='argument'>pattern</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><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>pattern</i>, + the repeat count <i>factor</i>, + and an integer stipple counter s. </p> + <p>Counter s is reset to 0 whenever <code>glBegin</code> is called, + and before each line segment of a <code>glBegin</code>(<code>GL_LINES</code>)/<code>glEnd</code> + sequence is generated. + It is incremented after each fragment of a unit width aliased line segment is generated, + or after each i fragments of an i width line segment are generated. + The i fragments associated with count s are masked out if + .sp + .ce + <i>pattern</i> bit (s ~/~ "factor") ~roman mod~ 16 + .sp + is 0, otherwise these fragments are sent to the frame buffer. + Bit zero of <i>pattern</i> is the least significant bit.</p> + <p>Antialiased lines are treated as a sequence of 1 times width rectangles + for purposes of stippling. + Whether rectagle s 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 <code>glEnable</code> and <code>glDisable</code> + with argument <code>GL_LINE_STIPPLE</code>. + 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> + </dd> + <dt class='head--doc'><span id='p-factor'></span>Parameter <code class='parameter'>factor</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a multiplier for each bit in the line stipple pattern. + If <i>factor</i> is 3, + for example, + each bit in the pattern is used three times + before the next bit in the pattern is used. + <i>factor</i> is clamped to the range [1, 256] and defaults to 1.</p> + </dd> + <dt class='head--doc'><span id='p-pattern'></span>Parameter <code class='parameter'>pattern</code></dt> + <dd></dd><dd class='body--doc'><p>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.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glLineStipple</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLineWidth</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLineWidth</span>(</b><code class='datatype'>float</code> <code class='argument'>width</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glLineWidth</code> specifies the rasterized width of both aliased and antialiased + lines. + Using a line width other than 1 has different effects, + depending on whether line antialiasing is enabled. + To enable and disable line antialiasing, call + <code>glEnable</code> and <code>glDisable</code> + with argument <code>GL_LINE_SMOOTH</code>. Line antialiasing is initially + disabled. </p> + <p>If line antialiasing is disabled, + the actual width is determined by rounding the supplied width + to the nearest integer. + (If the rounding results in the value 0, + it is as if the line width were 1.) + If + .nf + | DELTA x | &gt;= | DELTA y |, + .fi + <i>i</i> pixels are filled in each column that is rasterized, + where <i>i</i> is the rounded value of <i>width</i>. + Otherwise, + <i>i</i> pixels are filled in each row that is rasterized.</p> + <p>If antialiasing is enabled, + line rasterization produces a fragment for each pixel square + that intersects the region lying within the rectangle having width + equal to the current line width, + length equal to the actual length of the line, + and centered on the mathematical line segment. + The coverage value for each fragment is the window coordinate area + of the intersection of the rectangular region with the corresponding + pixel square. + This value is saved and used in the final rasterization step. </p> + <p>Not all widths can be supported when line antialiasing is enabled. + If an unsupported width is requested, + the nearest supported width is used. + Only width 1 is guaranteed to be supported; + others depend on the implementation. + To query the range of supported widths and the size difference between + supported widths within the range, call + <code>glGet</code> with arguments + <code>GL_LINE_WIDTH_RANGE</code> and + <code>GL_LINE_WIDTH_GRANULARITY</code>.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of rasterized lines. + The initial value is 1.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>width</i> is less than or equal to 0.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glLineWidth</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glListBase</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glListBase</span>(</b><code class='datatype'>int</code> <code class='argument'>base</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glCallLists</code> specifies an array of offsets. + Display-list names are generated by adding <i>base</i> to each offset. + Names that reference valid display lists are executed; + the others are ignored.</p> + </dd> + <dt class='head--doc'><span id='p-base'></span>Parameter <code class='parameter'>base</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies an integer offset that will be added to <code>glCallLists</code> + offsets to generate display-list names. + The initial value is 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glListBase</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLoadIdentity</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLoadIdentity</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glLoadIdentity</code> replaces the current matrix with the identity matrix. + It is semantically equivalent to calling <code>glLoadMatrix</code> + with the identity matrix</p> + <p>.ce</p> + <p>.EQ + left ( down 20 { ~ matrix { +  ccol { 1 above 0 above 0 above 0~ } +  ccol { 0 above 1 above 0 above 0~ } +  ccol { 0 above 0 above 1 above 0~ } +  ccol { 0 above 0 above 0 above 1 } + } } ~~ right ) + .EN</p> + <p>but in some cases it is more efficient.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glLoadIdentity</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLoadMatrix</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLoadMatrix</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>)) <code class='argument'>m</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glLoadMatrix</code> replaces the current matrix with the one whose elements are specified by + <i>m</i>. + The current matrix is the projection matrix, + modelview matrix, + or texture matrix, + depending on the current matrix mode + (see <code>glMatrixMode</code>).</p> + <p>The current matrix, M, defines a transformation of coordinates. + For instance, assume M refers to the modelview matrix. + If v ~=~ (v[0], v[1], v[2], v[3]) is the set of object coordinates + of a vertex, + and <i>m</i> points to an array of 16 + single- or double-precision + floating-point values m[0], m[1],. . .,m[15], + then the modelview transformation M(v) does the following:</p> + <p>.ce + .EQ + down 130 + {M(v) ~ = ~ + {{ left ( matrix { +  ccol { ~m[0] above m[1] above m[2] above m[3] ~} +  ccol { ~m[4] above m[5] above m[6] above m[7] ~} +  ccol { ~m[8] above m[9] above m[10] above m[11] ~} +  ccol { ~m[12]~ above m[13]~ above m[14]~ above m[15]~} + } right ) } ~~ times ~~ + {left ( matrix { + ccol { ~v[0]~ above ~v[1]~ above ~v[2]~ above ~v[3]~ } + } right )} }} + .EN</p> + <p>.sp</p> + <p>Where 'times' denotes matrix multiplication.</p> + <p>Projection and texture transformations are similarly defined.</p> + </dd> + <dt class='head--doc'><span id='p-m'></span>Parameter <code class='parameter'>m</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to 16 consecutive values, which are used as the + elements of a 4 times 4 column-major matrix.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glLoadMatrix</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLoadName</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLoadName</span>(</b><code class='datatype'>int</code> <code class='argument'>name</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The name stack is used during selection mode to allow sets of rendering + commands to be uniquely identified. + It consists of an ordered set of unsigned integers. + <code>glLoadName</code> causes <i>name</i> to replace the value on the top of the name stack, + which is initially empty.</p> + <p>The name stack is always empty while the render mode is not <code>GL_SELECT</code>. + Calls to <code>glLoadName</code> while the render mode is not <code>GL_SELECT</code> are ignored.</p> + </dd> + <dt class='head--doc'><span id='p-name'></span>Parameter <code class='parameter'>name</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a name that will replace the top value on the name stack.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glLoadName</code> is called while the + name stack is empty.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glLoadName</code> is executed between + the execution of <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glLogicOp</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glLogicOp</span>(</b><code class='datatype'>int</code> <code class='argument'>opcode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glLogicOp</code> specifies a logical operation that, + when enabled, + is applied between the incoming color index or RGBA color + and the color index or RGBA color at the corresponding location in the + frame buffer. + To enable or disable the logical operation, call + <code>glEnable</code> and <code>glDisable</code> + using the symbolic constant <code>GL_COLOR_LOGIC_OP</code> for RGBA mode or + <code>GL_INDEX_LOGIC_OP</code> for color index mode. The initial value is + disabled for both operations.</p> + <p>.ne + .TS + center box ; + ci | ci + c | c . + opcode resulting value + = + <code>GL_CLEAR</code> 0 + <code>GL_SET</code> 1 + <code>GL_COPY</code> s + <code>GL_COPY_INVERTED</code> ~s + <code>GL_NOOP</code> d + <code>GL_INVERT</code> ~d + <code>GL_AND</code> s &amp; d + <code>GL_NAND</code> ~(s &amp; d) + <code>GL_OR</code> s | d + <code>GL_NOR</code> ~(s | d) + <code>GL_XOR</code> s ^ d + <code>GL_EQUIV</code> ~(s ^ d) + <code>GL_AND_REVERSE</code> s &amp; ~d + <code>GL_AND_INVERTED</code> ~s &amp; d + <code>GL_OR_REVERSE</code> s | ~d + <code>GL_OR_INVERTED</code> ~s | d + .TE</p> + <p><i>opcode</i> is a symbolic constant chosen from the list above. + In the explanation of the logical operations, + <i>s</i> represents the incoming color index and + <i>d</i> represents the index in the frame buffer. + Standard C-language operators are used. + As these bitwise operators suggest, + the logical operation is applied independently to each bit pair of the + source and destination indices or colors.</p> + </dd> + <dt class='head--doc'><span id='p-opcode'></span>Parameter <code class='parameter'>opcode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic constant that selects a logical operation. + The following symbols are accepted: + <code>GL_CLEAR</code>, + <code>GL_SET</code>, + <code>GL_COPY</code>, + <code>GL_COPY_INVERTED</code>, + <code>GL_NOOP</code>, + <code>GL_INVERT</code>, + <code>GL_AND</code>, + <code>GL_NAND</code>, + <code>GL_OR</code>, + <code>GL_NOR</code>, + <code>GL_XOR</code>, + <code>GL_EQUIV</code>, + <code>GL_AND_REVERSE</code>, + <code>GL_AND_INVERTED</code>, + <code>GL_OR_REVERSE</code>, and + <code>GL_OR_INVERTED</code>. The initial value is <code>GL_COPY</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>opcode</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glLogicOp</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glMaterial</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glMaterial</span>(</b><code class='datatype'>int</code> <code class='argument'>face</code>, <code class='datatype'>int</code> <code class='argument'>pname</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>param</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glMaterial</code> assigns values to material parameters. + There are two matched sets of material parameters. + One, + the <i>front-facing</i> set, + is used to shade points, + lines, + bitmaps, + and all polygons + (when two-sided lighting is disabled), + or just front-facing polygons + (when two-sided lighting is enabled). + The other set, + <i>back-facing</i>, + is used to shade back-facing polygons only when two-sided lighting is enabled. + Refer to the <code>glLightModel</code> reference page for details concerning one- and + two-sided lighting calculations.</p> + <p><code>glMaterial</code> takes three arguments. + The first, + <i>face</i>, + specifies whether the + <code>GL_FRONT</code> materials, the + <code>GL_BACK</code> materials, or both + <code>GL_FRONT_AND_BACK</code> materials will be modified. + The second, + <i>pname</i>, + specifies which of several parameters in one or both sets will be modified. + The third, + <i>params</i>, + specifies what value or values will be assigned to the specified parameter.</p> + <p>Material parameters are used in the lighting equation that is optionally + applied to each vertex. + The equation is discussed in the <code>glLightModel</code> reference page. + The parameters that can be specified using <code>glMaterial</code>, + and their interpretations by the lighting equation, are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_AMBIENT</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the ambient RGBA reflectance of the material. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial ambient reflectance for both front- and back-facing materials + is (0.2, 0.2, 0.2, 1.0). + </td></tr> + <tr><td><code>GL_DIFFUSE</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the diffuse RGBA reflectance of the material. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial diffuse reflectance for both front- and back-facing materials + is (0.8, 0.8, 0.8, 1.0). + </td></tr> + <tr><td><code>GL_SPECULAR</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the specular RGBA reflectance of the material. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial specular reflectance for both front- and back-facing materials + is (0, 0, 0, 1). + </td></tr> + <tr><td><code>GL_EMISSION</code> + </td><td><i>params</i> contains four integer or floating-point values that specify + the RGBA emitted light intensity of the material. + Integer values are mapped linearly such that the most positive representable + value maps to 1.0, + and the most negative representable value maps to -1.0. + Floating-point values are mapped directly. + Neither integer nor floating-point values are clamped. + The initial emission intensity for both front- and back-facing materials + is (0, 0, 0, 1). + </td></tr> + <tr><td><code>GL_SHININESS</code> + </td><td><i>params</i> is a single integer or floating-point value that specifies + the RGBA specular exponent of the material. + Integer and floating-point values are mapped directly. + Only values in the range [0,128] are accepted. + The initial specular exponent for both front- and back-facing materials + is 0. + </td></tr> + <tr><td><code>GL_AMBIENT_AND_DIFFUSE</code> + </td><td>Equivalent to calling <code>glMaterial</code> twice with the same parameter values, + once with <code>GL_AMBIENT</code> and once with <code>GL_DIFFUSE</code>. + </td></tr> + <tr><td><code>GL_COLOR_INDEXES</code> + </td><td><i>params</i> contains three integer or floating-point values specifying + the color indices for ambient, + diffuse, + and specular lighting. + These three values, + and <code>GL_SHININESS</code>, + are the only material values used by the color index mode lighting equation. + Refer to the <code>glLightModel</code> reference page for a discussion + of color index lighting. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-face'></span>Parameter <code class='parameter'>face</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies which face or faces are being updated. + Must be one of + <code>GL_FRONT</code>, + <code>GL_BACK</code>, or + <code>GL_FRONT_AND_BACK</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the single-valued material parameter of the face or faces + that is being updated. + Must be <code>GL_SHININESS</code>.</p> + </dd> + <dt class='head--doc'><span id='p-param'></span>Parameter <code class='parameter'>param</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the value that parameter <code>GL_SHININESS</code> will be set to.</p> + </dd> + <dt class='head--doc'><span id='p-face'></span>Parameter <code class='parameter'>face</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies which face or faces are being updated. + Must be one of + <code>GL_FRONT</code>, + <code>GL_BACK</code>, or + <code>GL_FRONT_AND_BACK</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the material parameter of the face or faces that is being updated. + Must be one of + <code>GL_AMBIENT</code>, + <code>GL_DIFFUSE</code>, + <code>GL_SPECULAR</code>, + <code>GL_EMISSION</code>, + <code>GL_SHININESS</code>, + <code>GL_AMBIENT_AND_DIFFUSE</code>, or + <code>GL_COLOR_INDEXES</code>.</p> + </dd> + <dt class='head--doc'><span id='p-params'></span>Parameter <code class='parameter'>params</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to the value or values that <i>pname</i> will be set to.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if either <i>face</i> or <i>pname</i> is not + an accepted value.</p> + <p><code>GL_INVALID_VALUE</code> is generated if a specular exponent outside the range + [0,128] is specified.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glMatrixMode</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glMatrixMode</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glMatrixMode</code> sets the current matrix mode. + <i>mode</i> can assume one of three values:</p> + <p><table class='box'> + <tr><td><code>GL_MODELVIEW</code> + </td><td>Applies subsequent matrix operations to the modelview matrix stack. + </td></tr> + <tr><td><code>GL_PROJECTION</code> + </td><td>Applies subsequent matrix operations to the projection matrix stack. + </td></tr> + <tr><td><code>GL_TEXTURE</code> + </td><td>Applies subsequent matrix operations to the texture matrix stack. + </td></tr> + </table> + </p> + <p>To find out which matrix stack is currently the target of all matrix + operations, call <code>glGet</code> with argument <code>GL_MATRIX_MODE</code>. The initial + value is <code>GL_MODELVIEW</code>.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies which matrix stack is the target + for subsequent matrix operations. + Three values are accepted: + <code>GL_MODELVIEW</code>, + <code>GL_PROJECTION</code>, and + <code>GL_TEXTURE</code>. + The initial value is <code>GL_MODELVIEW</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glMatrixMode</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glMultMatrix</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glMultMatrix</span>(</b><code class='datatype'>array</code>(<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>)) <code class='argument'>m</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glMultMatrix</code> multiplies the current matrix with the one specified using <i>m</i>, and + replaces the current matrix with the product.</p> + <p>The current matrix is determined by the current matrix mode (see <code>glMatrixMode</code>). It is either the projection matrix, + modelview matrix, + or the texture matrix.</p> + </dd> + <dt class='head--doc'><span id='p-m'></span>Parameter <code class='parameter'>m</code></dt> + <dd></dd><dd class='body--doc'><p>Points to 16 consecutive values that are used as the elements of + a 4 times 4 column-major matrix.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glMultMatrix</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glNewList</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glNewList</span>(</b><code class='datatype'>int</code> <code class='argument'>list</code>, <code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Display lists are groups of GL commands that have been stored + for subsequent execution. + Display lists are created with <code>glNewList</code>. + All subsequent commands are placed in the display list, + in the order issued, + until <code>glEndList</code> is called. </p> + <p><code>glNewList</code> has two arguments. + The first argument, + <i>list</i>, + is a positive integer that becomes the unique name for the display list. + Names can be created and reserved with <code>glGenLists</code> + and tested for uniqueness with <code>glIsList</code>. + The second argument, + <i>mode</i>, + is a symbolic constant that can assume one of two values: </p> + <p><table class='box'> + <tr><td><code>GL_COMPILE</code> + </td><td>Commands are merely compiled. + </td></tr> + <tr><td><code>GL_COMPILE_AND_EXECUTE</code> + </td><td>Commands are executed as they are compiled into the display list. + </td></tr> + </table> + </p> + <p>Certain commands are not compiled into the display list + but are executed immediately, + regardless of the display-list mode. + These commands are + <code>glColorPointer</code>, + <code>glDeleteLists</code>, + <code>glDisableClientState</code>, + <code>glEdgeFlagPointer</code>, + <code>glEnableClientState</code>, + <code>glFeedbackBuffer</code>, + <code>glFinish</code>, + <code>glFlush</code>, + <code>glGenLists</code>, + <code>glIndexPointer</code>, + <code>glInterleavedArrays</code>, + <code>glIsEnabled</code>, + <code>glIsList</code>, + <code>glNormalPointer</code>, + <code>glPopClientAttrib</code>, + <code>glPixelStore</code>, + <code>glPushClientAttrib</code>, + <code>glReadPixels</code>, + <code>glRenderMode</code>, + <code>glSelectBuffer</code>, + <code>glTexCoordPointer</code>, + <code>glVertexPointer</code>, + and all of the <code>glGet</code> commands.</p> + <p>Similarly, + <code>glTexImage2D</code> and <code>glTexImage1D</code> + are executed immediately and not compiled into the display list when their + first argument is <code>GL_PROXY_TEXTURE_2D</code> or + <code>GL_PROXY_TEXTURE_1D</code>, respectively.</p> + <p>When <code>glEndList</code> is encountered, + the display-list definition is completed by associating the list + with the unique name <i>list</i> + (specified in the <code>glNewList</code> command). + If a display list with name <i>list</i> already exists, + it is replaced only when <code>glEndList</code> is called.</p> + </dd> + <dt class='head--doc'><span id='p-list'></span>Parameter <code class='parameter'>list</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the display-list name.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the compilation mode, + which can be + <code>GL_COMPILE</code> or + <code>GL_COMPILE_AND_EXECUTE</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>list</i> is 0.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glEndList</code> is called + without a preceding <code>glNewList</code>, + or if <code>glNewList</code> is called while a display list is being defined.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glNewList</code> or <code>glEndList</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + <p><code>GL_OUT_OF_MEMORY</code> is generated if there is insufficient memory to + compile the display list. If the GL version is 1.1 or greater, no + change is made to the previous contents of the display list, if any, + and no other change is made to the GL state. (It is as if no attempt + had been made to create the new display list.)</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glNormal</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glNormal</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>nx</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>ny</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>nz</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The current normal is set to the given coordinates + whenever <code>glNormal</code> is issued. + Byte, short, or integer arguments are converted to floating-point + format with a linear mapping that maps the most positive representable integer + value to 1.0, + and the most negative representable integer value to -1.0.</p> + <p>Normals specified with <code>glNormal</code> need not have unit length. + If normalization is enabled, + then normals specified with <code>glNormal</code> are normalized after transformation. + To enable and disable normalization, call <code>glEnable</code> and <code>glDisable</code> + with the argument <code>GL_NORMALIZE</code>. + Normalization is initially disabled.</p> + </dd> + <dt class='head--doc'><span id='p-nx'></span>Parameter <code class='parameter'>nx</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the x, y, and z coordinates of the new current normal. + The initial value of the current normal is the unit vector, (0, 0, 1).</p> + </dd> + <dt class='head--doc'><span id='p-v'></span>Parameter <code class='parameter'>v</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array of three elements: + the x, y, and z coordinates of the new current normal.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glOrtho</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glOrtho</span>(</b><code class='datatype'>float</code> <code class='argument'>left</code>, <code class='datatype'>float</code> <code class='argument'>right</code>, <code class='datatype'>float</code> <code class='argument'>bottom</code>, <code class='datatype'>float</code> <code class='argument'>top</code>, <code class='datatype'>float</code> <code class='argument'>zNear</code>, <code class='datatype'>float</code> <code class='argument'>zFar</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glOrtho</code> describes a transformation that produces a parallel projection. + The current matrix (see <code>glMatrixMode</code>) is multiplied by this matrix + and the result replaces the current matrix, as if + <code>glMultMatrix</code> were called with the following matrix + as its argument: + .sp + .ce + .EQ + left ( matrix { +  ccol { {2 over {"right" - "left"}} above 0 above 0 above 0 } +  ccol { 0 above {2 over {"top" - "bottom"}} above 0 above 0 } +  ccol { 0 above 0 above {-2 over {"zFar" - "zNear"}} above 0 } +  ccol { {t sub x}~ above {t sub y}~ above {t sub z}~ above 1~ } + } right ) + .EN</p> + <p>where + .ce + .EQ + t sub x ~=~ -{{"right" + "left"} over {"right" - "left"}} + .EN</p> + <p>.ce + .EQ + t sub y ~=~ -{{"top" + "bottom"} over {"top" - "bottom"}} + .EN</p> + <p>.ce + .EQ + t sub z ~=~ -{{"zFar" + "zNear"} over {"zFar" - "zNear"}} + .EN</p> + <p>.RE</p> + <p>Typically, the matrix mode is <code>GL_PROJECTION</code>, and + (<i>left</i>, <i>bottom</i>, -<i>zNear</i>) and (<i>right</i>, <i>top</i>, -<i>zNear</i>) + specify the points on the near clipping plane that are mapped + to the lower left and upper right corners of the window, + respectively, + assuming that the eye is located at (0, 0, 0). + -<i>zFar</i> specifies the location of the far clipping plane. + Both <i>zNear</i> and <i>zFar</i> can be either positive or negative.</p> + <p>Use <code>glPushMatrix</code> and <code>glPopMatrix</code> to save and restore + the current matrix stack.</p> + </dd> + <dt class='head--doc'><span id='p-left'></span>Parameter <code class='parameter'>left</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the coordinates for the left and right vertical clipping planes.</p> + </dd> + <dt class='head--doc'><span id='p-bottom'></span>Parameter <code class='parameter'>bottom</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the coordinates for the bottom and top horizontal clipping planes.</p> + </dd> + <dt class='head--doc'><span id='p-zNear'></span>Parameter <code class='parameter'>zNear</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the distances to the nearer and farther depth clipping planes. + These values are negative if the plane is to be behind the viewer.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glOrtho</code> + is executed between the execution of + <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPassThrough</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPassThrough</span>(</b><code class='datatype'>float</code> <code class='argument'>token</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Feedback is a GL render mode. + The mode is selected by calling + <code>glRenderMode</code> with <code>GL_FEEDBACK</code>. + When the GL is in feedback mode, + no pixels are produced by rasterization. + Instead, + information about primitives that would have been rasterized + is fed back to the application using the GL. + See the <code>glFeedbackBuffer</code> reference page for a description of the + feedback buffer and the values in it. </p> + <p><code>glPassThrough</code> inserts a user-defined marker in the feedback buffer + when it is executed in feedback mode. + <i>token</i> is returned as if it were a primitive; + it is indicated with its own unique identifying value: + <code>GL_PASS_THROUGH_TOKEN</code>. + The order of <code>glPassThrough</code> commands with respect to the specification + of graphics primitives is maintained.</p> + </dd> + <dt class='head--doc'><span id='p-token'></span>Parameter <code class='parameter'>token</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a marker value to be placed in the feedback buffer + following a <code>GL_PASS_THROUGH_TOKEN</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glPassThrough</code> is executed between + the execution of <code>glBegin</code> and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPixelZoom</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPixelZoom</span>(</b><code class='datatype'>float</code> <code class='argument'>xfactor</code>, <code class='datatype'>float</code> <code class='argument'>yfactor</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glPixelZoom</code> specifies values for the x and y zoom factors. + During the execution of <code>glDrawPixels</code> or <code>glCopyPixels</code>, + if (xr , yr ) is the current raster position, + and a given element is in the mth row and nth column of the pixel rectangle, + then pixels whose centers are in the rectangle with corners at + .sp + .ce + (xr ~+~ n cdot "xfactor", yr ~+~ m cdot "yfactor") + .sp + .ce + (xr ~+~ (n+1) cdot "xfactor", yr ~+~ (m+1) cdot "yfactor") + .sp + are candidates for replacement. + Any pixel whose center lies on the bottom or left edge of this rectangular + region is also modified.</p> + <p>Pixel zoom factors are not limited to positive values. + Negative zoom factors reflect the resulting image about the current + raster position.</p> + </dd> + <dt class='head--doc'><span id='p-xfactor'></span>Parameter <code class='parameter'>xfactor</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the x and y zoom factors for pixel write operations.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glPixelZoom</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPointSize</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPointSize</span>(</b><code class='datatype'>float</code> <code class='argument'>size</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glPointSize</code> specifies the rasterized diameter of both aliased and antialiased + points. + Using a point size other than 1 has different effects, + depending on whether point antialiasing is enabled. + To enable and disable point antialiasing, call + <code>glEnable</code> and <code>glDisable</code> + with argument <code>GL_POINT_SMOOTH</code>. Point antialiasing is initially disabled.</p> + <p>If point antialiasing is disabled, + the actual size is determined by rounding the supplied size + to the nearest integer. + (If the rounding results in the value 0, + it is as if the point size were 1.) + If the rounded size is odd, + then the center point + ( x , y ) + of the pixel fragment that represents the point is computed as + .sp + .ce + ( \(lf ~ x sub w ~ \(rf ~+~ .5 , \(lf ~ y sub w ~ \(rf ~+~ .5 ) + .sp + where w subscripts indicate window coordinates. + All pixels that lie within the square grid of the rounded size centered at + ( x , y ) + make up the fragment. + If the size is even, + the center point is + .sp + .ce + ( \(lf ~ x sub w ~+~ .5 ~ \(rf, \(lf ~ y sub w ~+~ .5 ~ \(rf ) + .sp + and the rasterized fragment's centers are the half-integer window coordinates + within the square of the rounded size centered at + ( x , y ). + All pixel fragments produced in rasterizing a nonantialiased point are + assigned the same associated data, + that of the vertex corresponding to the point.</p> + <p>If antialiasing is enabled, + then point rasterization produces a fragment for each pixel square + that intersects the region lying within the circle having diameter + equal to the current point size and centered at the point's + ( x sub w , y sub w ). + The coverage value for each fragment is the window coordinate area + of the intersection of the circular region with the corresponding pixel square. + This value is saved and used in the final rasterization step. + The data associated with each fragment is the data associated with + the point being rasterized.</p> + <p>Not all sizes are supported when point antialiasing is enabled. + If an unsupported size is requested, + the nearest supported size is used. + Only size 1 is guaranteed to be supported; + others depend on the implementation. + To query the range of supported sizes and the size difference between + supported sizes within the range, call + <code>glGet</code> with arguments + <code>GL_POINT_SIZE_RANGE</code> and + <code>GL_POINT_SIZE_GRANULARITY</code>.</p> + </dd> + <dt class='head--doc'><span id='p-size'></span>Parameter <code class='parameter'>size</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the diameter of rasterized points. + The initial value is 1.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if <i>size</i> is less than or equal to 0.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPointSize</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPolygonMode</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPolygonMode</span>(</b><code class='datatype'>int</code> <code class='argument'>face</code>, <code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glPolygonMode</code> controls the interpretation of polygons for rasterization. + <i>face</i> describes which polygons <i>mode</i> applies to: + front-facing polygons (<code>GL_FRONT</code>), + back-facing polygons (<code>GL_BACK</code>), + or both (<code>GL_FRONT_AND_BACK</code>). + The polygon mode affects only the final rasterization of polygons. + In particular, + a polygon's vertices are lit and + the polygon is clipped and possibly culled before these modes are applied.</p> + <p>Three modes are defined and can be specified in <i>mode</i>:</p> + <p><table class='box'> + <tr><td><code>GL_POINT</code> + </td><td>Polygon vertices that are marked as the start of a boundary edge + are drawn as points. + Point attributes such as + <code>GL_POINT_SIZE</code> and + <code>GL_POINT_SMOOTH</code> control + the rasterization of the points. + Polygon rasterization attributes other than <code>GL_POLYGON_MODE</code> have no effect. + </td></tr> + <tr><td><code>GL_LINE</code> + </td><td>Boundary edges of the polygon are drawn as line segments. + They are treated as connected line segments for line stippling; + the line stipple counter and pattern are not reset between segments + (see <code>glLineStipple</code>). + Line attributes such as + <code>GL_LINE_WIDTH</code> and + <code>GL_LINE_SMOOTH</code> control + the rasterization of the lines. + Polygon rasterization attributes other than <code>GL_POLYGON_MODE</code> have no effect. + </td></tr> + <tr><td><code>GL_FILL</code> + </td><td>The interior of the polygon is filled. + Polygon attributes such as + <code>GL_POLYGON_STIPPLE</code> and + <code>GL_POLYGON_SMOOTH</code> control the rasterization of the polygon. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-face'></span>Parameter <code class='parameter'>face</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the polygons that <i>mode</i> applies to. + Must be + <code>GL_FRONT</code> for front-facing polygons, + <code>GL_BACK</code> for back-facing polygons, + or <code>GL_FRONT_AND_BACK</code> for front- and back-facing polygons.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies how polygons will be rasterized. + Accepted values are + <code>GL_POINT</code>, + <code>GL_LINE</code>, and + <code>GL_FILL</code>. + The initial value is <code>GL_FILL</code> for both front- and back-facing polygons.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if either <i>face</i> or <i>mode</i> is not + an accepted value.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPolygonMode</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPolygonOffset</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPolygonOffset</span>(</b><code class='datatype'>float</code> <code class='argument'>factor</code>, <code class='datatype'>float</code> <code class='argument'>units</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>When <code>GL_POLYGON_OFFSET</code> is enabled, each + fragment's <i>depth</i> value will be offset after it is interpolated + from the <i>depth</i> values of the appropriate vertices. + The value of the offset is "factor" ~*~ DZ ~~+~~ r ~*~ "units", + where DZ~ is a measurement of the change in depth relative to the screen + area of the polygon, and r is the smallest value that is guaranteed to + produce a resolvable offset for a given implementation. + The offset is added before the depth test is performed and before + the value is written into the depth buffer.</p> + <p><code>glPolygonOffset</code> is useful for rendering hidden-line images, for applying decals + to surfaces, and for rendering solids with highlighted edges.</p> + </dd> + <dt class='head--doc'><span id='p-factor'></span>Parameter <code class='parameter'>factor</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a scale factor that is used to create a variable + depth offset for each polygon. The initial value is 0.</p> + </dd> + <dt class='head--doc'><span id='p-units'></span>Parameter <code class='parameter'>units</code></dt> + <dd></dd><dd class='body--doc'><p>Is multiplied by an implementation-specific value to + create a constant depth offset. The initial value is 0.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glPolygonOffset</code> is executed + between the execution of <code>glBegin</code> and the corresponding + execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPopAttrib</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPopAttrib</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glPushAttrib</code> takes one argument, + a mask that indicates which groups of state variables + to save on the attribute stack. + Symbolic constants are used to set bits in the mask. + <i>mask</i> + is typically constructed by ORing several of these constants together. + The special mask + <code>GL_ALL_ATTRIB_BITS</code> + can be used to save all stackable states.</p> + <p>The symbolic mask constants and their associated GL state are as follows + (the second column lists which attributes are saved):</p> + <p>.TS + ; + l l . + <code>GL_ACCUM_BUFFER_BIT</code> Accumulation buffer clear value</p> + <p><code>GL_COLOR_BUFFER_BIT</code> <code>GL_ALPHA_TEST</code> enable bit +  Alpha test function and reference value +  <code>GL_BLEND</code> enable bit +  Blending source and destination functions +  Constant blend color +  Blending equation +  <code>GL_DITHER</code> enable bit +  <code>GL_DRAW_BUFFER</code> setting +  <code>GL_COLOR_LOGIC_OP</code> enable bit +  <code>GL_INDEX_LOGIC_OP</code> enable bit +  Logic op function +  Color mode and index mode clear values +  Color mode and index mode writemasks</p> + <p><code>GL_CURRENT_BIT</code> Current RGBA color +  Current color index +  Current normal vector +  Current texture coordinates +  Current raster position +  <code>GL_CURRENT_RASTER_POSITION_VALID</code> flag +  RGBA color associated with current raster position +  Color index associated with current raster position +  Texture coordinates associated with current raster position +  <code>GL_EDGE_FLAG</code> flag</p> + <p><code>GL_DEPTH_BUFFER_BIT</code> <code>GL_DEPTH_TEST</code> enable bit +  Depth buffer test function +  Depth buffer clear value +  <code>GL_DEPTH_WRITEMASK</code> enable bit</p> + <p><code>GL_ENABLE_BIT</code> <code>GL_ALPHA_TEST</code> flag +  <code>GL_AUTO_NORMAL</code> flag +  <code>GL_BLEND</code> flag +  Enable bits for the user-definable clipping planes +  <code>GL_COLOR_MATERIAL</code> +  <code>GL_CULL_FACE</code> flag +  <code>GL_DEPTH_TEST</code> flag +  <code>GL_DITHER</code> flag +  <code>GL_FOG</code> flag +  <code>GL_LIGHT</code><i>i</i> where 0\ &lt;= <i>i</i>&lt;<code>GL_MAX_LIGHTS</code> +  <code>GL_LIGHTING</code> flag +  <code>GL_LINE_SMOOTH</code> flag +  <code>GL_LINE_STIPPLE</code> flag +  <code>GL_COLOR_LOGIC_OP</code> flag +  <code>GL_INDEX_LOGIC_OP</code> flag +  <code>GL_MAP1_</code><i>x</i> where <i>x</i> is a map type +  <code>GL_MAP2_</code><i>x</i> where <i>x</i> is a map type +  <code>GL_NORMALIZE</code> flag +  <code>GL_POINT_SMOOTH</code> flag +  <code>GL_POLYGON_OFFSET_LINE</code> flag +  <code>GL_POLYGON_OFFSET_FILL</code> flag +  <code>GL_POLYGON_OFFSET_POINT</code> flag +  <code>GL_POLYGON_SMOOTH</code> flag +  <code>GL_POLYGON_STIPPLE</code> flag +  <code>GL_SCISSOR_TEST</code> flag +  <code>GL_STENCIL_TEST</code> flag +  <code>GL_TEXTURE_1D</code> flag +  <code>GL_TEXTURE_2D</code> flag +  Flags <code>GL_TEXTURE_GEN_</code><i>x</i> where <i>x</i> is S, T, R, or Q </p> + <p><code>GL_EVAL_BIT</code> <code>GL_MAP1_</code><i>x</i> enable bits, where <i>x</i> is a map type +  <code>GL_MAP2_</code><i>x</i> enable bits, where <i>x</i> is a map type +  1D grid endpoints and divisions +  2D grid endpoints and divisions +  <code>GL_AUTO_NORMAL</code> enable bit</p> + <p><code>GL_FOG_BIT</code> <code>GL_FOG</code> enable bit +  Fog color +  Fog density +  Linear fog start +  Linear fog end +  Fog index +  <code>GL_FOG_MODE</code> value</p> + <p><code>GL_HINT_BIT</code> <code>GL_PERSPECTIVE_CORRECTION_HINT</code> setting +  <code>GL_POINT_SMOOTH_HINT</code> setting +  <code>GL_LINE_SMOOTH_HINT</code> setting +  <code>GL_POLYGON_SMOOTH_HINT</code> setting +  <code>GL_FOG_HINT</code> setting</p> + <p><code>GL_LIGHTING_BIT</code> <code>GL_COLOR_MATERIAL</code> enable bit +  <code>GL_COLOR_MATERIAL_FACE</code> value +  Color material parameters that are tracking the current color +  Ambient scene color +  <code>GL_LIGHT_MODEL_LOCAL_VIEWER</code> value +  <code>GL_LIGHT_MODEL_TWO_SIDE</code> setting +  <code>GL_LIGHTING</code> enable bit +  Enable bit for each light +  Ambient, diffuse, and specular intensity for each light +  Direction, position, exponent, and cutoff angle for each light +  Constant, linear, and quadratic attenuation factors for each light +  Ambient, diffuse, specular, and emissive color for each material +  Ambient, diffuse, and specular color indices for each material +  Specular exponent for each material +  <code>GL_SHADE_MODEL</code> setting</p> + <p><code>GL_LINE_BIT</code> <code>GL_LINE_SMOOTH</code> flag +  <code>GL_LINE_STIPPLE</code> enable bit +  Line stipple pattern and repeat counter +  Line width</p> + <p><code>GL_LIST_BIT</code> <code>GL_LIST_BASE</code> setting</p> + <p><code>GL_PIXEL_MODE_BIT</code> <code>GL_RED_BIAS</code> and <code>GL_RED_SCALE</code> settings +  <code>GL_GREEN_BIAS</code> and <code>GL_GREEN_SCALE</code> values +  <code>GL_BLUE_BIAS</code> and <code>GL_BLUE_SCALE</code> +  <code>GL_ALPHA_BIAS</code> and <code>GL_ALPHA_SCALE</code> +  <code>GL_DEPTH_BIAS</code> and <code>GL_DEPTH_SCALE</code> +  <code>GL_INDEX_OFFSET</code> and <code>GL_INDEX_SHIFT</code> values +  <code>GL_MAP_COLOR</code> and <code>GL_MAP_STENCIL</code> flags +  <code>GL_ZOOM_X</code> and <code>GL_ZOOM_Y</code> factors +  <code>GL_READ_BUFFER</code> setting</p> + <p><code>GL_POINT_BIT</code> <code>GL_POINT_SMOOTH</code> flag +  Point size</p> + <p><code>GL_POLYGON_BIT</code> <code>GL_CULL_FACE</code> enable bit +  <code>GL_CULL_FACE_MODE</code> value +  <code>GL_FRONT_FACE</code> indicator +  <code>GL_POLYGON_MODE</code> setting +  <code>GL_POLYGON_SMOOTH</code> flag +  <code>GL_POLYGON_STIPPLE</code> enable bit +  <code>GL_POLYGON_OFFSET_FILL</code> flag +  <code>GL_POLYGON_OFFSET_LINE</code> flag +  <code>GL_POLYGON_OFFSET_POINT</code> flag +  <code>GL_POLYGON_OFFSET_FACTOR</code> +  <code>GL_POLYGON_OFFSET_UNITS</code></p> + <p><code>GL_POLYGON_STIPPLE_BIT</code> Polygon stipple image</p> + <p><code>GL_SCISSOR_BIT</code> <code>GL_SCISSOR_TEST</code> flag +  Scissor box</p> + <p><code>GL_STENCIL_BUFFER_BIT</code> <code>GL_STENCIL_TEST</code> enable bit +  Stencil function and reference value +  Stencil value mask +  Stencil fail, pass, and depth buffer pass actions +  Stencil buffer clear value +  Stencil buffer writemask</p> + <p><code>GL_TEXTURE_BIT</code> Enable bits for the four texture coordinates +  Border color for each texture image +  Minification function for each texture image +  Magnification function for each texture image +  Texture coordinates and wrap mode for each texture image +  Color and mode for each texture environment +  Enable bits <code>GL_TEXTURE_GEN_</code><i>x</i>, <i>x</i> is S, T, R, and Q +  <code>GL_TEXTURE_GEN_MODE</code> setting for S, T, R, and Q +  <code>glTexGen</code> plane equations for S, T, R, and Q +  Current texture bindings (for example, <code>GL_TEXTURE_2D_BINDING</code>)</p> + <p><code>GL_TRANSFORM_BIT</code> Coefficients of the six clipping planes +  Enable bits for the user-definable clipping planes +  <code>GL_MATRIX_MODE</code> value +  <code>GL_NORMALIZE</code> flag</p> + <p><code>GL_VIEWPORT_BIT</code> Depth range (near and far) +  Viewport origin and extent + .TE</p> + <p><code>glPopAttrib</code> restores the values of the state variables saved with the last</p> + <p><code>glPushAttrib</code> command. + Those not saved are left unchanged.</p> + <p>It is an error to push attributes onto a full stack, + or to pop attributes off an empty stack. + In either case, the error flag is set + and no other change is made to GL state.</p> + <p>Initially, the attribute stack is empty.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a mask that indicates which attributes to save. Values for + <i>mask</i> are listed below.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushAttrib</code> is called while + the attribute stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopAttrib</code> is called while + the attribute stack is empty.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPushAttrib</code> or <code>glPopAttrib</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPopClientAttrib</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPopClientAttrib</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glPushClientAttrib</code> takes one argument, + a mask that indicates which groups of client-state variables + to save on the client attribute stack. + Symbolic constants are used to set bits in the mask. + <i>mask</i> + is typically constructed by OR'ing several of these constants together. + The special mask + <code>GL_CLIENT_ALL_ATTRIB_BITS</code> + can be used to save all stackable client state.</p> + <p>The symbolic mask constants and their associated GL client state are as follows + (the second column lists which attributes are saved):</p> + <p><code>GL_CLIENT_PIXEL_STORE_BIT</code> Pixel storage modes</p> + <p><code>GL_CLIENT_VERTEX_ARRAY_BIT</code> Vertex arrays (and enables)</p> + <p><code>glPopClientAttrib</code> restores the values of the client-state variables + saved with the last <code>glPushClientAttrib</code>. + Those not saved are left unchanged.</p> + <p>It is an error to push attributes onto a full client attribute stack, + or to pop attributes off an empty stack. + In either case, the error flag is set, + and no other change is made to GL state.</p> + <p>Initially, the client attribute stack is empty.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a mask that indicates which attributes to save. Values for + <i>mask</i> are listed below.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushClientAttrib</code> is called while + the attribute stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopClientAttrib</code> is called while + the attribute stack is empty.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPopMatrix</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPopMatrix</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>There is a stack of matrices for each of the matrix modes. + In <code>GL_MODELVIEW</code> mode, + the stack depth is at least 32. + In the other two modes, + <code>GL_PROJECTION</code> and <code>GL_TEXTURE</code>, + the depth is at least 2. + The current matrix in any mode is the matrix on the top of the stack + for that mode.</p> + <p><code>glPushMatrix</code> pushes the current matrix stack down by one, + duplicating the current matrix. + That is, + after a <code>glPushMatrix</code> call, + the matrix on top of the stack is identical to the one below it.</p> + <p><code>glPopMatrix</code> pops the current matrix stack, + replacing the current matrix with the one below it on the stack. </p> + <p>Initially, each of the stacks contains one matrix, an identity matrix.</p> + <p>It is an error to push a full matrix stack, + or to pop a matrix stack that contains only a single matrix. + In either case, the error flag is set + and no other change is made to GL state.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushMatrix</code> is called while + the current matrix stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopMatrix</code> is called while + the current matrix stack contains only a single matrix.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPushMatrix</code> or <code>glPopMatrix</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPopName</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPopName</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The name stack is used during selection mode to allow sets of rendering + commands to be uniquely identified. + It consists of an ordered set of unsigned integers and is initially empty.</p> + <p><code>glPushName</code> causes <i>name</i> to be pushed onto the name stack. + <code>glPopName</code> pops one name off the top of the stack. </p> + <p>The maximum name stack depth is implementation-dependent; call + <code>GL_MAX_NAME_STACK_DEPTH</code> to find out the value for a particular + implementation. It is an + error to push a name onto a full stack, + or to pop a name off an empty stack. + It is also an error to manipulate the name stack between the execution of + <code>glBegin</code> and the corresponding execution of <code>glEnd</code>. + In any of these cases, the error flag is set and no other change is + made to GL state.</p> + <p>The name stack is always empty while the render mode is not <code>GL_SELECT</code>. + Calls to <code>glPushName</code> or <code>glPopName</code> while the render mode is not + <code>GL_SELECT</code> are ignored.</p> + </dd> + <dt class='head--doc'><span id='p-name'></span>Parameter <code class='parameter'>name</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a name that will be pushed onto the name stack.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushName</code> is called while the + name stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopName</code> is called while the + name stack is empty.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPushName</code> or <code>glPopName</code> + is executed between a call to <code>glBegin</code> and the corresponding call to + <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPushAttrib</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPushAttrib</span>(</b><code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glPushAttrib</code> takes one argument, + a mask that indicates which groups of state variables + to save on the attribute stack. + Symbolic constants are used to set bits in the mask. + <i>mask</i> + is typically constructed by ORing several of these constants together. + The special mask + <code>GL_ALL_ATTRIB_BITS</code> + can be used to save all stackable states.</p> + <p>The symbolic mask constants and their associated GL state are as follows + (the second column lists which attributes are saved):</p> + <p>.TS + ; + l l . + <code>GL_ACCUM_BUFFER_BIT</code> Accumulation buffer clear value</p> + <p><code>GL_COLOR_BUFFER_BIT</code> <code>GL_ALPHA_TEST</code> enable bit +  Alpha test function and reference value +  <code>GL_BLEND</code> enable bit +  Blending source and destination functions +  Constant blend color +  Blending equation +  <code>GL_DITHER</code> enable bit +  <code>GL_DRAW_BUFFER</code> setting +  <code>GL_COLOR_LOGIC_OP</code> enable bit +  <code>GL_INDEX_LOGIC_OP</code> enable bit +  Logic op function +  Color mode and index mode clear values +  Color mode and index mode writemasks</p> + <p><code>GL_CURRENT_BIT</code> Current RGBA color +  Current color index +  Current normal vector +  Current texture coordinates +  Current raster position +  <code>GL_CURRENT_RASTER_POSITION_VALID</code> flag +  RGBA color associated with current raster position +  Color index associated with current raster position +  Texture coordinates associated with current raster position +  <code>GL_EDGE_FLAG</code> flag</p> + <p><code>GL_DEPTH_BUFFER_BIT</code> <code>GL_DEPTH_TEST</code> enable bit +  Depth buffer test function +  Depth buffer clear value +  <code>GL_DEPTH_WRITEMASK</code> enable bit</p> + <p><code>GL_ENABLE_BIT</code> <code>GL_ALPHA_TEST</code> flag +  <code>GL_AUTO_NORMAL</code> flag +  <code>GL_BLEND</code> flag +  Enable bits for the user-definable clipping planes +  <code>GL_COLOR_MATERIAL</code> +  <code>GL_CULL_FACE</code> flag +  <code>GL_DEPTH_TEST</code> flag +  <code>GL_DITHER</code> flag +  <code>GL_FOG</code> flag +  <code>GL_LIGHT</code><i>i</i> where 0\ &lt;= <i>i</i>&lt;<code>GL_MAX_LIGHTS</code> +  <code>GL_LIGHTING</code> flag +  <code>GL_LINE_SMOOTH</code> flag +  <code>GL_LINE_STIPPLE</code> flag +  <code>GL_COLOR_LOGIC_OP</code> flag +  <code>GL_INDEX_LOGIC_OP</code> flag +  <code>GL_MAP1_</code><i>x</i> where <i>x</i> is a map type +  <code>GL_MAP2_</code><i>x</i> where <i>x</i> is a map type +  <code>GL_NORMALIZE</code> flag +  <code>GL_POINT_SMOOTH</code> flag +  <code>GL_POLYGON_OFFSET_LINE</code> flag +  <code>GL_POLYGON_OFFSET_FILL</code> flag +  <code>GL_POLYGON_OFFSET_POINT</code> flag +  <code>GL_POLYGON_SMOOTH</code> flag +  <code>GL_POLYGON_STIPPLE</code> flag +  <code>GL_SCISSOR_TEST</code> flag +  <code>GL_STENCIL_TEST</code> flag +  <code>GL_TEXTURE_1D</code> flag +  <code>GL_TEXTURE_2D</code> flag +  Flags <code>GL_TEXTURE_GEN_</code><i>x</i> where <i>x</i> is S, T, R, or Q </p> + <p><code>GL_EVAL_BIT</code> <code>GL_MAP1_</code><i>x</i> enable bits, where <i>x</i> is a map type +  <code>GL_MAP2_</code><i>x</i> enable bits, where <i>x</i> is a map type +  1D grid endpoints and divisions +  2D grid endpoints and divisions +  <code>GL_AUTO_NORMAL</code> enable bit</p> + <p><code>GL_FOG_BIT</code> <code>GL_FOG</code> enable bit +  Fog color +  Fog density +  Linear fog start +  Linear fog end +  Fog index +  <code>GL_FOG_MODE</code> value</p> + <p><code>GL_HINT_BIT</code> <code>GL_PERSPECTIVE_CORRECTION_HINT</code> setting +  <code>GL_POINT_SMOOTH_HINT</code> setting +  <code>GL_LINE_SMOOTH_HINT</code> setting +  <code>GL_POLYGON_SMOOTH_HINT</code> setting +  <code>GL_FOG_HINT</code> setting</p> + <p><code>GL_LIGHTING_BIT</code> <code>GL_COLOR_MATERIAL</code> enable bit +  <code>GL_COLOR_MATERIAL_FACE</code> value +  Color material parameters that are tracking the current color +  Ambient scene color +  <code>GL_LIGHT_MODEL_LOCAL_VIEWER</code> value +  <code>GL_LIGHT_MODEL_TWO_SIDE</code> setting +  <code>GL_LIGHTING</code> enable bit +  Enable bit for each light +  Ambient, diffuse, and specular intensity for each light +  Direction, position, exponent, and cutoff angle for each light +  Constant, linear, and quadratic attenuation factors for each light +  Ambient, diffuse, specular, and emissive color for each material +  Ambient, diffuse, and specular color indices for each material +  Specular exponent for each material +  <code>GL_SHADE_MODEL</code> setting</p> + <p><code>GL_LINE_BIT</code> <code>GL_LINE_SMOOTH</code> flag +  <code>GL_LINE_STIPPLE</code> enable bit +  Line stipple pattern and repeat counter +  Line width</p> + <p><code>GL_LIST_BIT</code> <code>GL_LIST_BASE</code> setting</p> + <p><code>GL_PIXEL_MODE_BIT</code> <code>GL_RED_BIAS</code> and <code>GL_RED_SCALE</code> settings +  <code>GL_GREEN_BIAS</code> and <code>GL_GREEN_SCALE</code> values +  <code>GL_BLUE_BIAS</code> and <code>GL_BLUE_SCALE</code> +  <code>GL_ALPHA_BIAS</code> and <code>GL_ALPHA_SCALE</code> +  <code>GL_DEPTH_BIAS</code> and <code>GL_DEPTH_SCALE</code> +  <code>GL_INDEX_OFFSET</code> and <code>GL_INDEX_SHIFT</code> values +  <code>GL_MAP_COLOR</code> and <code>GL_MAP_STENCIL</code> flags +  <code>GL_ZOOM_X</code> and <code>GL_ZOOM_Y</code> factors +  <code>GL_READ_BUFFER</code> setting</p> + <p><code>GL_POINT_BIT</code> <code>GL_POINT_SMOOTH</code> flag +  Point size</p> + <p><code>GL_POLYGON_BIT</code> <code>GL_CULL_FACE</code> enable bit +  <code>GL_CULL_FACE_MODE</code> value +  <code>GL_FRONT_FACE</code> indicator +  <code>GL_POLYGON_MODE</code> setting +  <code>GL_POLYGON_SMOOTH</code> flag +  <code>GL_POLYGON_STIPPLE</code> enable bit +  <code>GL_POLYGON_OFFSET_FILL</code> flag +  <code>GL_POLYGON_OFFSET_LINE</code> flag +  <code>GL_POLYGON_OFFSET_POINT</code> flag +  <code>GL_POLYGON_OFFSET_FACTOR</code> +  <code>GL_POLYGON_OFFSET_UNITS</code></p> + <p><code>GL_POLYGON_STIPPLE_BIT</code> Polygon stipple image</p> + <p><code>GL_SCISSOR_BIT</code> <code>GL_SCISSOR_TEST</code> flag +  Scissor box</p> + <p><code>GL_STENCIL_BUFFER_BIT</code> <code>GL_STENCIL_TEST</code> enable bit +  Stencil function and reference value +  Stencil value mask +  Stencil fail, pass, and depth buffer pass actions +  Stencil buffer clear value +  Stencil buffer writemask</p> + <p><code>GL_TEXTURE_BIT</code> Enable bits for the four texture coordinates +  Border color for each texture image +  Minification function for each texture image +  Magnification function for each texture image +  Texture coordinates and wrap mode for each texture image +  Color and mode for each texture environment +  Enable bits <code>GL_TEXTURE_GEN_</code><i>x</i>, <i>x</i> is S, T, R, and Q +  <code>GL_TEXTURE_GEN_MODE</code> setting for S, T, R, and Q +  <code>glTexGen</code> plane equations for S, T, R, and Q +  Current texture bindings (for example, <code>GL_TEXTURE_2D_BINDING</code>)</p> + <p><code>GL_TRANSFORM_BIT</code> Coefficients of the six clipping planes +  Enable bits for the user-definable clipping planes +  <code>GL_MATRIX_MODE</code> value +  <code>GL_NORMALIZE</code> flag</p> + <p><code>GL_VIEWPORT_BIT</code> Depth range (near and far) +  Viewport origin and extent + .TE</p> + <p><code>glPopAttrib</code> restores the values of the state variables saved with the last</p> + <p><code>glPushAttrib</code> command. + Those not saved are left unchanged.</p> + <p>It is an error to push attributes onto a full stack, + or to pop attributes off an empty stack. + In either case, the error flag is set + and no other change is made to GL state.</p> + <p>Initially, the attribute stack is empty.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a mask that indicates which attributes to save. Values for + <i>mask</i> are listed below.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushAttrib</code> is called while + the attribute stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopAttrib</code> is called while + the attribute stack is empty.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPushAttrib</code> or <code>glPopAttrib</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPushClientAttrib</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPushClientAttrib</span>(</b><code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glPushClientAttrib</code> takes one argument, + a mask that indicates which groups of client-state variables + to save on the client attribute stack. + Symbolic constants are used to set bits in the mask. + <i>mask</i> + is typically constructed by OR'ing several of these constants together. + The special mask + <code>GL_CLIENT_ALL_ATTRIB_BITS</code> + can be used to save all stackable client state.</p> + <p>The symbolic mask constants and their associated GL client state are as follows + (the second column lists which attributes are saved):</p> + <p><code>GL_CLIENT_PIXEL_STORE_BIT</code> Pixel storage modes</p> + <p><code>GL_CLIENT_VERTEX_ARRAY_BIT</code> Vertex arrays (and enables)</p> + <p><code>glPopClientAttrib</code> restores the values of the client-state variables + saved with the last <code>glPushClientAttrib</code>. + Those not saved are left unchanged.</p> + <p>It is an error to push attributes onto a full client attribute stack, + or to pop attributes off an empty stack. + In either case, the error flag is set, + and no other change is made to GL state.</p> + <p>Initially, the client attribute stack is empty.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a mask that indicates which attributes to save. Values for + <i>mask</i> are listed below.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushClientAttrib</code> is called while + the attribute stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopClientAttrib</code> is called while + the attribute stack is empty.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPushMatrix</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPushMatrix</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>There is a stack of matrices for each of the matrix modes. + In <code>GL_MODELVIEW</code> mode, + the stack depth is at least 32. + In the other two modes, + <code>GL_PROJECTION</code> and <code>GL_TEXTURE</code>, + the depth is at least 2. + The current matrix in any mode is the matrix on the top of the stack + for that mode.</p> + <p><code>glPushMatrix</code> pushes the current matrix stack down by one, + duplicating the current matrix. + That is, + after a <code>glPushMatrix</code> call, + the matrix on top of the stack is identical to the one below it.</p> + <p><code>glPopMatrix</code> pops the current matrix stack, + replacing the current matrix with the one below it on the stack. </p> + <p>Initially, each of the stacks contains one matrix, an identity matrix.</p> + <p>It is an error to push a full matrix stack, + or to pop a matrix stack that contains only a single matrix. + In either case, the error flag is set + and no other change is made to GL state.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushMatrix</code> is called while + the current matrix stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopMatrix</code> is called while + the current matrix stack contains only a single matrix.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPushMatrix</code> or <code>glPopMatrix</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glPushName</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glPushName</span>(</b><code class='datatype'>int</code> <code class='argument'>name</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The name stack is used during selection mode to allow sets of rendering + commands to be uniquely identified. + It consists of an ordered set of unsigned integers and is initially empty.</p> + <p><code>glPushName</code> causes <i>name</i> to be pushed onto the name stack. + <code>glPopName</code> pops one name off the top of the stack. </p> + <p>The maximum name stack depth is implementation-dependent; call + <code>GL_MAX_NAME_STACK_DEPTH</code> to find out the value for a particular + implementation. It is an + error to push a name onto a full stack, + or to pop a name off an empty stack. + It is also an error to manipulate the name stack between the execution of + <code>glBegin</code> and the corresponding execution of <code>glEnd</code>. + In any of these cases, the error flag is set and no other change is + made to GL state.</p> + <p>The name stack is always empty while the render mode is not <code>GL_SELECT</code>. + Calls to <code>glPushName</code> or <code>glPopName</code> while the render mode is not + <code>GL_SELECT</code> are ignored.</p> + </dd> + <dt class='head--doc'><span id='p-name'></span>Parameter <code class='parameter'>name</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a name that will be pushed onto the name stack.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_STACK_OVERFLOW</code> is generated if <code>glPushName</code> is called while the + name stack is full.</p> + <p><code>GL_STACK_UNDERFLOW</code> is generated if <code>glPopName</code> is called while the + name stack is empty.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glPushName</code> or <code>glPopName</code> + is executed between a call to <code>glBegin</code> and the corresponding call to + <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glRasterPos</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glRasterPos</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>x</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>y</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>z</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>w</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>The GL maintains a 3D position in window coordinates. + This position, + called the raster position, + is used to position pixel and bitmap write operations. It is + maintained with subpixel accuracy. + See <code>glBitmap</code>, <code>glDrawPixels</code>, and <code>glCopyPixels</code>.</p> + <p>The current raster position consists of three window coordinates + (x, y, z), + a clip coordinate value (w), + an eye coordinate distance, + a valid bit, + and associated color data and texture coordinates. + The w coordinate is a clip coordinate, + because w is not projected to window coordinates. + <code>glRasterPos4</code> specifies object coordinates x, y, z, and w + explicitly. + <code>glRasterPos3</code> specifies object coordinate x, y, and z explicitly, + while w is implicitly set to 1. + <code>glRasterPos2</code> uses the argument values for x and y while + implicitly setting z and w to 0 and 1. </p> + <p>The object coordinates presented by <code>glRasterPos</code> are treated just like those + of a <code>glVertex</code> command: + They are transformed by the current modelview and projection matrices + and passed to the clipping stage. + If the vertex is not culled, + then it is projected and scaled to window coordinates, + which become the new current raster position, + and the <code>GL_CURRENT_RASTER_POSITION_VALID</code> flag is set. + If the vertex + .I is + culled, + then the valid bit is cleared and the current raster position + and associated color and texture coordinates are undefined.</p> + <p>The current raster position also includes some associated color data + and texture coordinates. + If lighting is enabled, + then <code>GL_CURRENT_RASTER_COLOR</code> + (in RGBA mode) + or <code>GL_CURRENT_RASTER_INDEX</code> + (in color index mode) + is set to the color produced by the lighting calculation + (see <code>glLight</code>, <code>glLightModel</code>, and </p> + <p><code>glShadeModel</code>). + If lighting is disabled, + current color + (in RGBA mode, state variable <code>GL_CURRENT_COLOR</code>) + or color index + (in color index mode, state variable <code>GL_CURRENT_INDEX</code>) + is used to update the current raster color.</p> + <p>Likewise, + <code>GL_CURRENT_RASTER_TEXTURE_COORDS</code> is updated as a function + of <code>GL_CURRENT_TEXTURE_COORDS</code>, + based on the texture matrix and the texture generation functions + (see <code>glTexGen</code>). + Finally, + the distance from the origin of the eye coordinate system to the + vertex as transformed by only the modelview matrix replaces + <code>GL_CURRENT_RASTER_DISTANCE</code>.</p> + <p>Initially, the current raster position is (0, 0, 0, 1), + the current raster distance is 0, + the valid bit is set, + the associated RGBA color is (1, 1, 1, 1), + the associated color index is 1, + and the associated texture coordinates are (0, 0, 0, 1). + In RGBA mode, + <code>GL_CURRENT_RASTER_INDEX</code> is always 1; + in color index mode, + the current raster RGBA color always maintains its initial value.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the x, y, z, and w object coordinates + (if present) + for the raster position.</p> + </dd> + <dt class='head--doc'><span id='p-v'></span>Parameter <code class='parameter'>v</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array of two, + three, + or four elements, + specifying x, y, z, and w coordinates, respectively.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glRasterPos</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glReadBuffer</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glReadBuffer</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glReadBuffer</code> specifies a color buffer as the source for subsequent + <code>glReadPixels</code>, <code>glCopyTexImage1D</code>, <code>glCopyTexImage2D</code>, + <code>glCopyTexSubImage1D</code>, <code>glCopyTexSubImage2D</code>, and + <code>glCopyPixels</code> commands. + <i>mode</i> accepts one of twelve or more predefined values. + (<code>GL_AUX0</code> through <code>GL_AUX3</code> are always defined.) + In a fully configured system, + <code>GL_FRONT</code>, + <code>GL_LEFT</code>, and + <code>GL_FRONT_LEFT</code> all name the front left buffer, + <code>GL_FRONT_RIGHT</code> and + <code>GL_RIGHT</code> name the front right buffer, and + <code>GL_BACK_LEFT</code> and + <code>GL_BACK</code> name the back left buffer.</p> + <p>Nonstereo double-buffered configurations have only a front left and a + back left buffer. + Single-buffered configurations have a front left and a front right + buffer if stereo, and only a front left buffer if nonstereo. + It is an error to specify a nonexistent buffer to <code>glReadBuffer</code>.</p> + <p><i>mode</i> is initially <code>GL_FRONT</code> in single-buffered configurations, + and <code>GL_BACK</code> in double-buffered configurations.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a color buffer. + Accepted values are + <code>GL_FRONT_LEFT</code>, + <code>GL_FRONT_RIGHT</code>, + <code>GL_BACK_LEFT</code>, + <code>GL_BACK_RIGHT</code>, + <code>GL_FRONT</code>, + <code>GL_BACK</code>, + <code>GL_LEFT</code>, + <code>GL_RIGHT</code>, and + <code>GL_AUX</code><i>i</i>, + where <i>i</i> is between 0 and <code>GL_AUX_BUFFERS</code> -1.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not one of the twelve + (or more) accepted values.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <i>mode</i> specifies a buffer + that does not exist.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glReadBuffer</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glRenderMode</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glRenderMode</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glRenderMode</code> sets the rasterization mode. + It takes one argument, + <i>mode</i>, + which can assume one of three predefined values: </p> + <p><table class='box'> + <tr><td><code>GL_RENDER</code> + </td><td>Render mode. Primitives are rasterized, + producing pixel fragments, + which are written into the frame buffer. + This is the normal mode + and also the default mode. + </td></tr> + <tr><td><code>GL_SELECT</code> + </td><td>Selection mode. + No pixel fragments are produced, + and no change to the frame buffer contents is made. + Instead, + a record of the names of primitives that would have been drawn + if the render mode had been <code>GL_RENDER</code> is returned in a select buffer, + which must be created (see <code>glSelectBuffer</code>) before selection mode + is entered. + </td></tr> + <tr><td><code>GL_FEEDBACK</code> + </td><td>Feedback mode. + No pixel fragments are produced, + and no change to the frame buffer contents is made. + Instead, + the coordinates and attributes of vertices that would have been drawn + if the render mode had been <code>GL_RENDER</code> is returned in a feedback buffer, + which must be created (see <code>glFeedbackBuffer</code>) before feedback mode + is entered. + </td></tr> + </table> + </p> + <p>The return value of <code>glRenderMode</code> is determined by the render mode at the time + <code>glRenderMode</code> is called, + rather than by <i>mode</i>. + The values returned for the three render modes are as follows:</p> + <p><table class='box'> + <tr><td><code>GL_RENDER</code> + </td><td>0. + </td></tr> + <tr><td><code>GL_SELECT</code> + </td><td>The number of hit records transferred to the select buffer. + </td></tr> + <tr><td><code>GL_FEEDBACK</code> + </td><td>The number of values (not vertices) transferred to the feedback buffer. + </td></tr> + </table> + </p> + <p>See the <code>glSelectBuffer</code> and <code>glFeedbackBuffer</code> reference pages for + more details concerning selection and feedback operation.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the rasterization mode. + Three values are accepted: + <code>GL_RENDER</code>, + <code>GL_SELECT</code>, and + <code>GL_FEEDBACK</code>. + The initial value is <code>GL_RENDER</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is not one of the three + accepted values.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glSelectBuffer</code> is called + while the render mode is <code>GL_SELECT</code>, + or if <code>glRenderMode</code> is called with argument <code>GL_SELECT</code> before + <code>glSelectBuffer</code> is called at least once.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glFeedbackBuffer</code> is called + while the render mode is <code>GL_FEEDBACK</code>, + or if <code>glRenderMode</code> is called with argument <code>GL_FEEDBACK</code> before + <code>glFeedbackBuffer</code> is called at least once.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glRenderMode</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glRotate</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glRotate</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>angle</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>x</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>y</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>z</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glRotate</code> produces a rotation of <i>angle</i> degrees around + the vector ("x", "y", "z"). + The current matrix (see <code>glMatrixMode</code>) is multiplied by a rotation + matrix with the product + replacing the current matrix, as if <code>glMultMatrix</code> were called + with the following matrix as its argument:</p> + <p>.ce + .EQ + left ( ~ down 20 matrix { +  ccol { "x" "x" (1 - c)+ c above "y" "x" (1 - c)+ "z" s above "x" "z" (1 - c)-"y" s above ~0 } +  ccol {"x" "y" (1 - c)-"z" s above "y" "y" (1 - c)+ c above "y" "z" (1 - c)+ "x" s above ~0 } +  ccol { "x" "z" (1 - c)+ "y" s above "y" "z" (1 - c)- "x" s above "z" "z" (1 - c) + c above ~0 } +  ccol { ~0 above ~0 above ~0 above ~1} + } ~~ right ) + .EN</p> + <p>.sp + Where c ~=~ cos("angle"), s ~=~ sine("angle"), and + ||(~"x", "y", "z"~)|| ~=~ 1 (if not, the GL + will normalize this vector). + .sp + .sp</p> + <p>If the matrix mode is either <code>GL_MODELVIEW</code> or <code>GL_PROJECTION</code>, + all objects drawn after <code>glRotate</code> is called are rotated. + Use <code>glPushMatrix</code> and <code>glPopMatrix</code> to save and restore + the unrotated coordinate system.</p> + </dd> + <dt class='head--doc'><span id='p-angle'></span>Parameter <code class='parameter'>angle</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the angle of rotation, in degrees.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the <i>x</i>, <i>y</i>, and <i>z</i> coordinates of a vector, respectively.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glRotate</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glScale</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glScale</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>x</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>y</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>z</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glScale</code> produces a nonuniform scaling along the <i>x</i>, <i>y</i>, and + <i>z</i> axes. + The three parameters indicate the desired scale factor along + each of the three axes.</p> + <p>The current matrix + (see <code>glMatrixMode</code>) + is multiplied by this scale matrix, + and the product replaces the current matrix + as if <code>glScale</code> were called with the following matrix + as its argument:</p> + <p>.ce + .EQ + left ( ~ down 20 matrix { +  ccol { ~"x" above ~0 above ~0 above ~0 } +  ccol { ~0 above ~"y" above ~0 above ~0 } +  ccol { ~0 above ~0 above ~"z" above ~0 } +  ccol { ~0 above ~0 above ~0 above ~1} + } ~~ right ) + .EN + .sp + If the matrix mode is either <code>GL_MODELVIEW</code> or <code>GL_PROJECTION</code>, + all objects drawn after <code>glScale</code> is called are scaled.</p> + <p>Use <code>glPushMatrix</code> and <code>glPopMatrix</code> to save and restore + the unscaled coordinate system.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify scale factors along the <i>x</i>, <i>y</i>, and <i>z</i> axes, respectively.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glScale</code> + is executed between the execution of + <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glScissor</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glScissor</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glScissor</code> defines a rectangle, called the scissor box, + in window coordinates. + The first two arguments, + <i>x</i> and <i>y</i>, + specify the lower left corner of the box. + <i>width</i> and <i>height</i> specify the width and height of the box. </p> + <p>To enable and disable the scissor test, call + <code>glEnable</code> and <code>glDisable</code> with argument + <code>GL_SCISSOR_TEST</code>. The test is initially disabled. + While the test is enabled, only pixels that lie within the scissor box + can be modified by drawing commands. + Window coordinates have integer values at the shared corners of + frame buffer pixels. + \f7glScissor(0,0,1,1)\fP allows modification of only the lower left + pixel in the window, and \f7glScissor(0,0,0,0)\fP doesn't allow + modification of any pixels in the window. </p> + <p>When the scissor test is disabled, + it is as though the scissor box includes the entire window.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the lower left corner of the scissor box. + Initially (0, 0).</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the width and height of the scissor box. + When a GL context is first attached to a window, + <i>width</i> and <i>height</i> are set to the dimensions of that window.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if either <i>width</i> or <i>height</i> is negative.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glScissor</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glShadeModel</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glShadeModel</span>(</b><code class='datatype'>int</code> <code class='argument'>mode</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>GL primitives can have either flat or smooth shading. + Smooth shading, + the default, + causes the computed colors of vertices to be interpolated as the + primitive is rasterized, + typically assigning different colors to each resulting pixel fragment. + Flat shading selects the computed color of just one vertex + and assigns it to all the pixel fragments + generated by rasterizing a single primitive. + In either case, the computed color of a vertex is the result of + lighting if lighting is enabled, + or it is the current color at the time the vertex was specified if + lighting is disabled. </p> + <p>Flat and smooth shading are indistinguishable for points. + Starting when <code>glBegin</code> is issued and counting vertices and + primitives from 1, the GL gives each flat-shaded line segment i the + computed color of vertex i + 1, its second vertex. + Counting similarly from 1, + the GL gives each flat-shaded polygon the computed color of the vertex listed + in the following table. + This is the last vertex to specify the polygon in all cases except single + polygons, + where the first vertex specifies the flat-shaded color. + .sp + .TS + center box; + l | c . + <i>primitive type of polygon</i> i <i>vertex</i> + = + Single polygon ( i == 1 ) 1 + Triangle strip i + 2 + Triangle fan i + 2 + Independent triangle 3 i + Quad strip 2 i + 2 + Independent quad 4 i + .TE + .sp + Flat and smooth shading are specified by <code>glShadeModel</code> with <i>mode</i> set to + <code>GL_FLAT</code> and <code>GL_SMOOTH</code>, respectively.</p> + </dd> + <dt class='head--doc'><span id='p-mode'></span>Parameter <code class='parameter'>mode</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a symbolic value representing a shading technique. + Accepted values are <code>GL_FLAT</code> and <code>GL_SMOOTH</code>. + The initial value is <code>GL_SMOOTH</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>mode</i> is any value other than + <code>GL_FLAT</code> or <code>GL_SMOOTH</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glShadeModel</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glStencilFunc</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glStencilFunc</span>(</b><code class='datatype'>int</code> <code class='argument'>func</code>, <code class='datatype'>int</code> <code class='argument'>ref</code>, <code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering.</p> + <p>The stencil test conditionally eliminates a pixel based on the outcome + of a comparison between the reference value + and the value in the stencil buffer. + To enable and disable the test, call <code>glEnable</code> and <code>glDisable</code> + with argument <code>GL_STENCIL_TEST</code>. + To specify actions based on the outcome of the stencil test, call + <code>glStencilOp</code>.</p> + <p><i>func</i> is a symbolic constant that determines the stencil comparison function. + It accepts one of eight values, + shown in the following list. + <i>ref</i> is an integer reference value that is used in the stencil comparison. + It is clamped to the range [0,2 sup n - 1], + where n is the number of bitplanes in the stencil buffer. + <i>mask</i> is bitwise ANDed with both the reference value + and the stored stencil value, + with the ANDed values participating in the comparison. + .P + If <i>stencil</i> represents the value stored in the corresponding + stencil buffer location, + the following list shows the effect of each comparison function + that can be specified by <i>func</i>. + Only if the comparison succeeds is the pixel passed through + to the next stage in the rasterization process + (see <code>glStencilOp</code>). + All tests treat <i>stencil</i> values as unsigned integers in the range + [0,2 sup n - 1], + where n is the number of bitplanes in the stencil buffer.</p> + <p>The following values are accepted by <i>func</i>:</p> + <p><table class='box'> + <tr><td><code>GL_NEVER</code> + </td><td>Always fails. + </td></tr> + <tr><td><code>GL_LESS</code> + </td><td>Passes if ( <i>ref</i> &amp; <i>mask</i> ) &lt; ( <i>stencil</i> &amp; <i>mask</i> ). + </td></tr> + <tr><td><code>GL_LEQUAL</code> + </td><td>Passes if ( <i>ref</i> &amp; <i>mask</i> ) \(&lt;= ( <i>stencil</i> &amp; <i>mask</i> ). + </td></tr> + <tr><td><code>GL_GREATER</code> + </td><td>Passes if ( <i>ref</i> &amp; <i>mask</i> ) &gt; ( <i>stencil</i> &amp; <i>mask</i> ). + </td></tr> + <tr><td><code>GL_GEQUAL</code> + </td><td>Passes if ( <i>ref</i> &amp; <i>mask</i> ) \(&gt;= ( <i>stencil</i> &amp; <i>mask</i> ). + </td></tr> + <tr><td><code>GL_EQUAL</code> + </td><td>Passes if ( <i>ref</i> &amp; <i>mask</i> ) = ( <i>stencil</i> &amp; <i>mask</i> ). + </td></tr> + <tr><td><code>GL_NOTEQUAL</code> + </td><td>Passes if ( <i>ref</i> &amp; <i>mask</i> ) \(!= ( <i>stencil</i> &amp; <i>mask</i> ). + </td></tr> + <tr><td><code>GL_ALWAYS</code> + </td><td>Always passes. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-func'></span>Parameter <code class='parameter'>func</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the test function. + Eight tokens are valid: + <code>GL_NEVER</code>, + <code>GL_LESS</code>, + <code>GL_LEQUAL</code>, + <code>GL_GREATER</code>, + <code>GL_GEQUAL</code>, + <code>GL_EQUAL</code>, + <code>GL_NOTEQUAL</code>, and + <code>GL_ALWAYS</code>. The initial value is <code>GL_ALWAYS</code>.</p> + </dd> + <dt class='head--doc'><span id='p-ref'></span>Parameter <code class='parameter'>ref</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the reference value for the stencil test. + <i>ref</i> is clamped to the range [0,2 sup n - 1], + where n is the number of bitplanes in the stencil buffer. The + initial value is 0.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a mask that is ANDed with both the reference value + and the stored stencil value when the test is done. The initial value + is all 1's.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>func</i> is not one of the eight + accepted values.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glStencilFunc</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glStencilMask</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glStencilMask</span>(</b><code class='datatype'>int</code> <code class='argument'>mask</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glStencilMask</code> controls the writing of individual bits in the stencil planes. + The least significant n bits of <i>mask</i>, + where n is the number of bits in the stencil buffer, + specify a mask. + Where a 1 appears in the mask, + it's possible to write to the corresponding bit in the stencil buffer. + Where a 0 appears, + the corresponding bit is write-protected. + Initially, all bits are enabled for writing.</p> + </dd> + <dt class='head--doc'><span id='p-mask'></span>Parameter <code class='parameter'>mask</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a bit mask to enable and disable writing of individual bits + in the stencil planes. + Initially, the mask is all 1's.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glStencilMask</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glStencilOp</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glStencilOp</span>(</b><code class='datatype'>int</code> <code class='argument'>fail</code>, <code class='datatype'>int</code> <code class='argument'>zfail</code>, <code class='datatype'>int</code> <code class='argument'>zpass</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Stenciling, + like depth-buffering, + enables and disables drawing on a per-pixel basis. + You draw into the stencil planes using GL drawing primitives, + then render geometry and images, + using the stencil planes to mask out portions of the screen. + Stenciling is typically used in multipass rendering algorithms + to achieve special effects, + such as decals, + outlining, + and constructive solid geometry rendering.</p> + <p>The stencil test conditionally eliminates a pixel based on the outcome + of a comparison between the value in the stencil buffer and a + reference value. To enable and disable the test, call <code>glEnable</code> + and <code>glDisable</code> with argument + <code>GL_STENCIL_TEST</code>; to control it, call <code>glStencilFunc</code>.</p> + <p><code>glStencilOp</code> takes three arguments that indicate what happens + to the stored stencil value while stenciling is enabled. + If the stencil test fails, + no change is made to the pixel's color or depth buffers, + and <i>fail</i> specifies what happens to the stencil buffer contents. + The following six actions are possible.</p> + <p><table class='box'> + <tr><td><code>GL_KEEP</code> + </td><td>Keeps the current value. + </td></tr> + <tr><td><code>GL_ZERO</code> + </td><td>Sets the stencil buffer value to 0. + </td></tr> + <tr><td><code>GL_REPLACE</code> + </td><td>Sets the stencil buffer value to <i>ref</i>, + as specified by <code>glStencilFunc</code>. + </td></tr> + <tr><td><code>GL_INCR</code> + </td><td>Increments the current stencil buffer value. + Clamps to the maximum representable unsigned value. + </td></tr> + <tr><td><code>GL_DECR</code> + </td><td>Decrements the current stencil buffer value. + Clamps to 0. + </td></tr> + <tr><td><code>GL_INVERT</code> + </td><td>Bitwise inverts the current stencil buffer value. + </td></tr> + </table> + </p> + <p>Stencil buffer values are treated as unsigned integers. + When incremented and decremented, + values are clamped to 0 and 2 sup n - 1, + where n is the value returned by querying <code>GL_STENCIL_BITS</code>.</p> + <p>The other two arguments to <code>glStencilOp</code> specify stencil buffer actions + that depend on whether subsequent depth buffer tests succeed (<i>zpass</i>) + or fail (<i>zfail</i>) (see </p> + <p><code>glDepthFunc</code>). + The actions are specified using the same six symbolic constants as <i>fail</i>. + Note that <i>zfail</i> is ignored when there is no depth buffer, + or when the depth buffer is not enabled. + In these cases, <i>fail</i> and <i>zpass</i> specify stencil action when the + stencil test fails and passes, + respectively.</p> + </dd> + <dt class='head--doc'><span id='p-fail'></span>Parameter <code class='parameter'>fail</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the action to take when the stencil test fails. + Six symbolic constants are accepted: + <code>GL_KEEP</code>, + <code>GL_ZERO</code>, + <code>GL_REPLACE</code>, + <code>GL_INCR</code>, + <code>GL_DECR</code>, and + <code>GL_INVERT</code>. The initial value is <code>GL_KEEP</code>.</p> + </dd> + <dt class='head--doc'><span id='p-zfail'></span>Parameter <code class='parameter'>zfail</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the stencil action when the stencil test passes, + but the depth test fails. + <i>zfail</i> accepts the same symbolic constants as <i>fail</i>. The initial value + is <code>GL_KEEP</code>.</p> + </dd> + <dt class='head--doc'><span id='p-zpass'></span>Parameter <code class='parameter'>zpass</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the stencil action when both the stencil test and the depth + test pass, or when the stencil test passes and either there is no + depth buffer or depth testing is not enabled. + <i>zpass</i> accepts the same symbolic constants as <i>fail</i>. The initial value + is <code>GL_KEEP</code>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>fail</i>, + <i>zfail</i>, or <i>zpass</i> is any value other than the six defined constant values.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glStencilOp</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glTexCoord</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glTexCoord</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>s</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>t</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>r</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>q</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glTexCoord</code> specifies texture coordinates in + one, + two, + three, or + four dimensions. + <code>glTexCoord1</code> sets the current texture coordinates to + (<i>s</i>, 0, 0, 1); + a call to </p> + <p><code>glTexCoord2</code> sets them to + (<i>s</i>, <i>t</i>, 0, 1). + Similarly, <code>glTexCoord3</code> specifies the texture coordinates as + (<i>s</i>, <i>t</i>, <i>r</i>, 1), and + <code>glTexCoord4</code> defines all four components explicitly as + (<i>s</i>, <i>t</i>, <i>r</i>, <i>q</i>). </p> + <p>The current texture coordinates are part of the data + that is associated with each vertex and with the current + raster position. + Initially, the values for + <i>s</i>, + <i>t</i>, + <i>r</i>, and + <i>q</i> + are (0, 0, 0, 1).</p> + </dd> + <dt class='head--doc'><span id='p-s'></span>Parameter <code class='parameter'>s</code></dt> + <dd></dd><dd class='body--doc'><p>Specify <i>s</i>, <i>t</i>, <i>r</i>, and <i>q</i> texture coordinates. + Not all parameters are present in all forms of the command.</p> + </dd> + <dt class='head--doc'><span id='p-v'></span>Parameter <code class='parameter'>v</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array of one, two, three, or four elements, + which in turn specify the + <i>s</i>, + <i>t</i>, + <i>r</i>, and + <i>q</i> texture coordinates.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glTexEnv</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glTexEnv</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>pname</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>param</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>A texture environment specifies how texture values are interpreted + when a fragment is textured. + <i>target</i> must be <code>GL_TEXTURE_ENV</code>. + <i>pname</i> can be either <code>GL_TEXTURE_ENV_MODE</code> or <code>GL_TEXTURE_ENV_COLOR</code>.</p> + <p>If <i>pname</i> is <code>GL_TEXTURE_ENV_MODE</code>, + then <i>params</i> is (or points to) the symbolic name of a texture function. + Four texture functions may be specified: + <code>GL_MODULATE</code>, + <code>GL_DECAL</code>, + <code>GL_BLEND</code>, and + <code>GL_REPLACE</code>.</p> + <p>A texture function acts on the fragment to be textured using + the texture image value that applies to the fragment + (see <code>glTexParameter</code>) + and produces an RGBA color for that fragment. + The following table shows how the RGBA color is produced for each + of the three texture functions that can be chosen. + C is a triple of color values (RGB) and A is the associated alpha value. + RGBA values extracted from a texture image are in the range [0,1]. + The subscript f refers to the incoming fragment, + the subscript t to the texture image, + the subscript c to the texture environment color, + and subscript v indicates a value produced by the texture function.</p> + <p>A texture image can have up to four components per texture element + (see <code>glTexImage1D</code>, <code>glTexImage2D</code>, <code>glCopyTexImage1D</code>, and + <code>glCopyTexImage2D</code>). + In a one-component image, + L sub t indicates that single component. + A two-component image uses L sub t and A sub t. + A three-component image has only a color value, C sub t. + A four-component image has both a color value C sub t + and an alpha value A sub t.</p> + <p>.ne + .TS + center box tab(:) ; + ci || ci s s s + ci || c c c c + c || c | c | c | c. + Base internal:Texture functions + format:<code>GL_MODULATE</code>:<code>GL_DECAL</code>:<code>GL_BLEND</code>:<code>GL_REPLACE</code> + = + <code>GL_ALPHA</code>:C sub v = C sub f:undefined:C sub v = C sub f:C sub v = C sub f + \^ :A sub v = A sub f A sub t:\^:A sub v = A sub f:A sub v = A sub t + _ + <code>GL_LUMINANCE</code>:C sub v = L sub t C sub f:undefined:C sub v = ( 1 - L sub t ) C sub f:C sub v = L sub t + 1: : :+ L sub t C sub c: + : : : : + : A sub v = A sub f:\^: A sub v = A sub f:A sub v = A sub f + _ + <code>GL_LUMINANCE</code>:C sub v = L sub t C sub f:undefined:C sub v = ( 1 - L sub t ) C sub f :C sub v = L sub t + \<code>_ALPHA</code>: : : + L sub t C sub c + 2: : : : + :A sub v = A sub t A sub f:\^:A sub v = A sub t A sub f:A sub v = A sub t + _ + <code>GL_INTENSITY</code>:C sub v = C sub f I sub t:undefined:C sub v = ( 1 - I sub t ) C sub f :C sub v = I sub t + : : :+ I sub t C sub c + : : : : + \^ :A sub v = A sub f I sub t:\^:A sub v = ( 1 - I sub t ) A sub f :A sub v = I sub t + : : :+ I sub t A sub c: + _ + <code>GL_RGB</code>:C sub v = C sub t C sub f:C sub v = C sub t:C sub v = (1 - C sub t) C sub f :C sub v = C sub t + 3: : : + C sub t C sub c + : : : : + :A sub v = A sub f:A sub v = A sub f:A sub v = A sub f:A sub v = A sub f + _ + <code>GL_RGBA</code>:C sub v = C sub t C sub f:C sub v = ( 1 - A sub t ) C sub f :C sub v = (1 - C sub t) C sub f :C sub v = C sub t + 4: :+ A sub t C sub t: + C sub t C sub c + : : : : + :A sub v = A sub t A sub f:A sub v = A sub f:A sub v = A sub t A sub f:A sub v = A sub t + .TE + .sp + If <i>pname</i> is <code>GL_TEXTURE_ENV_COLOR</code>, + <i>params</i> is a pointer to an array that holds an RGBA color consisting of four + values. + Integer color components are interpreted linearly such that the most + positive integer maps to 1.0, + and the most negative integer maps to -1.0. + The values are clamped to the range [0,1] when they are specified. + C sub c takes these four values.</p> + <p><code>GL_TEXTURE_ENV_MODE</code> defaults to <code>GL_MODULATE</code> and + <code>GL_TEXTURE_ENV_COLOR</code> defaults to (0, 0, 0, 0).</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texture environment. + Must be <code>GL_TEXTURE_ENV</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the symbolic name of a single-valued texture environment parameter. + Must be <code>GL_TEXTURE_ENV_MODE</code>.</p> + </dd> + <dt class='head--doc'><span id='p-param'></span>Parameter <code class='parameter'>param</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a single symbolic constant, one of <code>GL_MODULATE</code>, + <code>GL_DECAL</code>, <code>GL_BLEND</code>, or <code>GL_REPLACE</code>.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texture environment. + Must be <code>GL_TEXTURE_ENV</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the symbolic name of a texture environment parameter. + Accepted values are <code>GL_TEXTURE_ENV_MODE</code> and <code>GL_TEXTURE_ENV_COLOR</code>.</p> + </dd> + <dt class='head--doc'><span id='p-params'></span>Parameter <code class='parameter'>params</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to a parameter array that contains + either a single symbolic constant or an RGBA color.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated when <i>target</i> or <i>pname</i> is not + one of the accepted defined values, + or when <i>params</i> should have a defined constant value + (based on the value of <i>pname</i>) + and does not.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glTexEnv</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glTexGen</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glTexGen</span>(</b><code class='datatype'>int</code> <code class='argument'>coord</code>, <code class='datatype'>int</code> <code class='argument'>pname</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>param</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glTexGen</code> selects a texture-coordinate generation function + or supplies coefficients for one of the functions. + <i>coord</i> names one of the (<i>s</i>, <i>t</i>, <i>r</i>, <i>q</i>) texture + coordinates; it must be one of the symbols + <code>GL_S</code>, + <code>GL_T</code>, + <code>GL_R</code>, or + <code>GL_Q</code>. + <i>pname</i> must be one of three symbolic constants: + <code>GL_TEXTURE_GEN_MODE</code>, + <code>GL_OBJECT_PLANE</code>, or + <code>GL_EYE_PLANE</code>. + If <i>pname</i> is <code>GL_TEXTURE_GEN_MODE</code>, + then <i>params</i> chooses a mode, + one of + <code>GL_OBJECT_LINEAR</code>, + <code>GL_EYE_LINEAR</code>, or + <code>GL_SPHERE_MAP</code>. + If <i>pname</i> is either <code>GL_OBJECT_PLANE</code> or <code>GL_EYE_PLANE</code>, + <i>params</i> contains coefficients for the corresponding + texture generation function. + .P + If the texture generation function is <code>GL_OBJECT_LINEAR</code>, + the function</p> + <p>.ce + g = p sub 1 x sub o + p sub 2 y sub o + p sub 3 z sub o + p sub 4 w sub o</p> + <p>is used, where g is the value computed for the coordinate named in <i>coord</i>, + p sub 1, + p sub 2, + p sub 3, + and + p sub 4 are the four values supplied in <i>params</i>, and + x sub o, + y sub o, + z sub o, and + w sub o are the object coordinates of the vertex. + This function can be used, for example, to texture-map terrain using sea level + as a reference plane + (defined by p sub 1, p sub 2, p sub 3, and p sub 4). + The altitude of a terrain vertex is computed by the <code>GL_OBJECT_LINEAR</code> + coordinate generation function as its distance from sea level; + that altitude can then be used to index the texture image to map white snow + onto peaks and green grass onto foothills.</p> + <p>If the texture generation function is <code>GL_EYE_LINEAR</code>, the function</p> + <p>.ce + g = {p sub 1} sup prime ~x sub e + {p sub 2} sup prime ~y sub e + {p sub 3} sup prime ~z sub e + {p sub 4} sup prime ~w sub e</p> + <p>is used, where </p> + <p>.ce + $( {p sub 1} sup prime + ~~{p sub 2} sup prime~~{p sub 3} sup prime~~ + {{p sub 4}sup prime}) = ( p sub 1~~ p sub 2~~ p sub 3~~ p sub 4 ) ~M sup -1$</p> + <p>and + x sub e, + y sub e, + z sub e, and + w sub e are the eye coordinates of the vertex, + p sub 1, + p sub 2, + p sub 3, + and + p sub 4 are the values supplied in <i>params</i>, and + M is the modelview matrix when <code>glTexGen</code> is invoked. + If M is poorly conditioned or singular, + texture coordinates generated by the resulting function may be inaccurate + or undefined.</p> + <p>Note that the values in <i>params</i> define a reference plane in eye coordinates. + The modelview matrix that is applied to them may not be the same one + in effect when the polygon vertices are transformed. + This function establishes a field of texture coordinates + that can produce dynamic contour lines on moving objects.</p> + <p>If <i>pname</i> is <code>GL_SPHERE_MAP</code> and <i>coord</i> is either + <code>GL_S</code> or + <code>GL_T</code>, + s and t texture coordinates are generated as follows. + Let <i>u</i> be the unit vector pointing from the origin to the polygon vertex + (in eye coordinates). + Let <i>n</i> sup prime be the current normal, + after transformation to eye coordinates. + Let </p> + <p>.ce + f ~=~ ( f sub x~~f sub y~~f sub z ) sup T + be the reflection vector such that</p> + <p>.ce + f ~=~ u ~-~ 2 n sup prime n sup prime sup T u</p> + <p>Finally, let m ~=~ 2 sqrt { f sub x sup {~2} + f sub y sup {~2} + (f sub z + 1 ) sup 2}. + Then the values assigned to the s and t texture coordinates are</p> + <p>.ce 1 + s ~=~ f sub x over m ~+~ 1 over 2 + .sp + .ce 1 + t ~=~ f sub y over m ~+~ 1 over 2</p> + <p>To enable or disable a texture-coordinate generation function, call + <code>glEnable</code> or <code>glDisable</code> + with one of the symbolic texture-coordinate names + (<code>GL_TEXTURE_GEN_S</code>, + <code>GL_TEXTURE_GEN_T</code>, + <code>GL_TEXTURE_GEN_R</code>, or + <code>GL_TEXTURE_GEN_Q</code>) as the argument. + When enabled, + the specified texture coordinate is computed + according to the generating function associated with that coordinate. + When disabled, + subsequent vertices take the specified texture coordinate + from the current set of texture coordinates. Initially, all texture + generation functions are set to <code>GL_EYE_LINEAR</code> and are disabled. + Both s plane equations are (1, 0, 0, 0), + both t plane equations are (0, 1, 0, 0), + and all r and q plane equations are (0, 0, 0, 0).</p> + </dd> + <dt class='head--doc'><span id='p-coord'></span>Parameter <code class='parameter'>coord</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texture coordinate. + Must be one of <code>GL_S</code>, <code>GL_T</code>, <code>GL_R</code>, or <code>GL_Q</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the symbolic name of the texture-coordinate generation function. + Must be <code>GL_TEXTURE_GEN_MODE</code>.</p> + </dd> + <dt class='head--doc'><span id='p-param'></span>Parameter <code class='parameter'>param</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a single-valued texture generation parameter, + one of <code>GL_OBJECT_LINEAR</code>, <code>GL_EYE_LINEAR</code>, or <code>GL_SPHERE_MAP</code>.</p> + </dd> + <dt class='head--doc'><span id='p-coord'></span>Parameter <code class='parameter'>coord</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texture coordinate. + Must be one of <code>GL_S</code>, <code>GL_T</code>, <code>GL_R</code>, or <code>GL_Q</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the symbolic name of the texture-coordinate generation function + or function parameters. + Must be + <code>GL_TEXTURE_GEN_MODE</code>, + <code>GL_OBJECT_PLANE</code>, or + <code>GL_EYE_PLANE</code>.</p> + </dd> + <dt class='head--doc'><span id='p-params'></span>Parameter <code class='parameter'>params</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array of texture generation parameters. + If <i>pname</i> is <code>GL_TEXTURE_GEN_MODE</code>, + then the array must contain a single symbolic constant, + one of + <code>GL_OBJECT_LINEAR</code>, + <code>GL_EYE_LINEAR</code>, or + <code>GL_SPHERE_MAP</code>. + Otherwise, + <i>params</i> holds the coefficients for the texture-coordinate generation function + specified by <i>pname</i>.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated when <i>coord</i> or <i>pname</i> is not an + accepted defined value, + or when <i>pname</i> is <code>GL_TEXTURE_GEN_MODE</code> and <i>params</i> is not an + accepted defined value.</p> + <p><code>GL_INVALID_ENUM</code> is generated when <i>pname</i> is <code>GL_TEXTURE_GEN_MODE</code>, + <i>params</i> is <code>GL_SPHERE_MAP</code>, + and <i>coord</i> is either <code>GL_R</code> or <code>GL_Q</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glTexGen</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glTexImage2D</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glTexImage2D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>internalformat</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>width</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>height</code>, <code class='datatype'>int</code> <code class='argument'>border</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>format</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>type</code>, <code class='datatype'>array</code>(<code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>)) <code class='argument'>pixels</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is enabled. + To enable and disable two-dimensional texturing, call <code>glEnable</code> + and <code>glDisable</code> with argument <code>GL_TEXTURE_2D</code>.</p> + <p>To define texture images, call <code>glTexImage2D</code>. + The arguments describe the parameters of the texture image, + such as height, + width, + width of the border, + level-of-detail number + (see <code>glTexParameter</code>), + and number of color components provided. + The last three arguments describe how the image is represented in memory; + they are identical to the pixel formats used for <code>glDrawPixels</code>.</p> + <p>If <i>target</i> is <code>GL_PROXY_TEXTURE_2D</code>, no data is read from <i>pixels</i>, but + all of the texture image state is recalculated, checked for + consistency, and checked + against the implementation's capabilities. If the implementation cannot + handle a texture of the requested texture size, it sets + all of the image state to 0, + but does not generate an error (see <code>glGetError</code>). To query for an + entire mipmap array, use an image array level greater than or equal to + 1. + .P + If <i>target</i> is <code>GL_TEXTURE_2D</code>, + data is read from <i>pixels</i> as a sequence of signed or unsigned bytes, + shorts, + or longs, + or single-precision floating-point values, + depending on <i>type</i>. + These values are grouped into sets of one, + two, + three, + or four values, + depending on <i>format</i>, + to form elements. + If <i>type</i> is <code>GL_BITMAP</code>, + the data is considered as a string of unsigned bytes (and + <i>format</i> must be <code>GL_COLOR_INDEX</code>). + Each data byte is treated as eight 1-bit elements, + with bit ordering determined by <code>GL_UNPACK_LSB_FIRST</code> + (see <code>glPixelStore</code>).</p> + <p>The first element corresponds to the lower left corner of the texture + image. + Subsequent elements progress left-to-right through the remaining texels + in the lowest row of the texture image, and then in successively higher + rows of the texture image. + The final element corresponds to the upper right corner of the texture + image.</p> + <p><i>format</i> determines the composition of each element in <i>pixels</i>. + It can assume one of nine symbolic values:</p> + <p><table class='box'> + <tr><td><code>GL_COLOR_INDEX</code> + </td><td>Each element is a single value, + a color index. + The GL converts it to fixed point + (with an unspecified number of zero bits to the right of the binary point), + shifted left or right depending on the value and sign of <code>GL_INDEX_SHIFT</code>, + and added to <code>GL_INDEX_OFFSET</code> + (see +  + <code>glPixelTransfer</code>). + The resulting index is converted to a set of color components + using the + <code>GL_PIXEL_MAP_I_TO_R</code>, + <code>GL_PIXEL_MAP_I_TO_G</code>, + <code>GL_PIXEL_MAP_I_TO_B</code>, and + <code>GL_PIXEL_MAP_I_TO_A</code> tables, + and clamped to the range [0,1]. + </td></tr> + <tr><td><code>GL_RED</code> + </td><td>Each element is a single red component. + The GL converts it to floating point and assembles it into an RGBA element + by attaching 0 for green and blue, and 1 for alpha. + Each component is then multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see <code>glPixelTransfer</code>). + </td></tr> + <tr><td><code>GL_GREEN</code> + </td><td>Each element is a single green component. + The GL converts it to floating point and assembles it into an RGBA element + by attaching 0 for red and blue, and 1 for alpha. + Each component is then multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see <code>glPixelTransfer</code>). + </td></tr> + <tr><td><code>GL_BLUE</code> + </td><td>Each element is a single blue component. + The GL converts it to floating point and assembles it into an RGBA element + by attaching 0 for red and green, and 1 for alpha. + Each component is then multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see <code>glPixelTransfer</code>). + </td></tr> + <tr><td><code>GL_ALPHA</code> + </td><td>Each element is a single alpha component. + The GL converts it to floating point and assembles it into an RGBA element + by attaching 0 for red, green, and blue. + Each component is then multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see <code>glPixelTransfer</code>). + </td></tr> + <tr><td><code>GL_RGB</code> + </td><td>Each element is an RGB triple. + The GL converts it to floating point and assembles it into an RGBA element + by attaching 1 for alpha. + Each component is then multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see +  + <code>glPixelTransfer</code>). + </td></tr> + <tr><td><code>GL_RGBA</code> + </td><td>Each element contains all four components. + Each component is multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see <code>glPixelTransfer</code>). + </td></tr> + <tr><td><code>GL_LUMINANCE</code> + </td><td>Each element is a single luminance value. + The GL converts it to floating point, + then assembles it into an RGBA element by replicating the luminance value + three times for red, green, and blue and attaching 1 for alpha. + Each component is then multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see <code>glPixelTransfer</code>). + </td></tr> + <tr><td><code>GL_LUMINANCE_ALPHA</code> + </td><td>Each element is a luminance/alpha pair. + The GL converts it to floating point, + then assembles it into an RGBA element by replicating the luminance value + three times for red, green, and blue. + Each component is then multiplied by the signed scale factor <code>GL_c_SCALE</code>, + added to the signed bias <code>GL_c_BIAS</code>, + and clamped to the range [0,1] + (see +  + <code>glPixelTransfer</code>). + </td></tr> + </table> + </p> + <p>Refer to the <code>glDrawPixels</code> reference page for a description of + the acceptable values for the <i>type</i> parameter.</p> + <p>If an application wants to store the texture at a certain + resolution or in a certain format, it can request the resolution + and format with <i>internalformat</i>. The GL will choose an internal + representation that closely approximates that requested by <i>internalformat</i>, but + it may not match exactly. + (The representations specified by <code>GL_LUMINANCE</code>, + <code>GL_LUMINANCE_ALPHA</code>, <code>GL_RGB</code>, + and <code>GL_RGBA</code> must match exactly. The numeric values 1, 2, 3, and 4 + may also be used to specify the above representations.)</p> + <p>Use the <code>GL_PROXY_TEXTURE_2D</code> target to try out a resolution and + format. The implementation will + update and recompute its best match for the requested storage resolution + and format. To then query this state, call + <code>glGetTexLevelParameter</code>. + If the texture cannot be accommodated, texture state is set to 0.</p> + <p>A one-component texture image uses only the red component of the RGBA + color extracted from <i>pixels</i>. + A two-component image uses the R and A values. + A three-component image uses the R, G, and B values. + A four-component image uses all of the RGBA components.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture. + Must be <code>GL_TEXTURE_2D</code> or <code>GL_PROXY_TEXTURE_2D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. + Level 0 is the base image level. + Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + </dd> + <dt class='head--doc'><span id='p-internalformat'></span>Parameter <code class='parameter'>internalformat</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the number of color components in the texture. + Must be 1, 2, 3, or 4, or one of the following symbolic constants: + <code>GL_ALPHA</code>, + <code>GL_ALPHA4</code>, + <code>GL_ALPHA8</code>, + <code>GL_ALPHA12</code>, + <code>GL_ALPHA16</code>, + <code>GL_LUMINANCE</code>, + <code>GL_LUMINANCE4</code>, + <code>GL_LUMINANCE8</code>, + <code>GL_LUMINANCE12</code>, + <code>GL_LUMINANCE16</code>, + <code>GL_LUMINANCE_ALPHA</code>, + <code>GL_LUMINANCE4_ALPHA4</code>, + <code>GL_LUMINANCE6_ALPHA2</code>, + <code>GL_LUMINANCE8_ALPHA8</code>, + <code>GL_LUMINANCE12_ALPHA4</code>, + <code>GL_LUMINANCE12_ALPHA12</code>, + <code>GL_LUMINANCE16_ALPHA16</code>, + <code>GL_INTENSITY</code>, + <code>GL_INTENSITY4</code>, + <code>GL_INTENSITY8</code>, + <code>GL_INTENSITY12</code>, + <code>GL_INTENSITY16</code>, + <code>GL_R3_G3_B2</code>, + <code>GL_RGB</code>, + <code>GL_RGB4</code>, + <code>GL_RGB5</code>, + <code>GL_RGB8</code>, + <code>GL_RGB10</code>, + <code>GL_RGB12</code>, + <code>GL_RGB16</code>, + <code>GL_RGBA</code>, + <code>GL_RGBA2</code>, + <code>GL_RGBA4</code>, + <code>GL_RGB5_A1</code>, + <code>GL_RGBA8</code>, + <code>GL_RGB10_A2</code>, + <code>GL_RGBA12</code>, or + <code>GL_RGBA16</code>.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the texture image. + Must be 2 sup n + 2 ( "border" ) for some integer n. All + implementations support texture images that are at least 64 texels + wide.</p> + </dd> + <dt class='head--doc'><span id='p-height'></span>Parameter <code class='parameter'>height</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the height of the texture image. + Must be 2 sup m + 2 ( "border" ) for some integer m. All + implementations support texture images that are at least 64 texels + high.</p> + </dd> + <dt class='head--doc'><span id='p-border'></span>Parameter <code class='parameter'>border</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the border. + Must be either 0 or 1.</p> + </dd> + <dt class='head--doc'><span id='p-format'></span>Parameter <code class='parameter'>format</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the format of the pixel data. + The following symbolic values are accepted: + <code>GL_COLOR_INDEX</code>, + <code>GL_RED</code>, + <code>GL_GREEN</code>, + <code>GL_BLUE</code>, + <code>GL_ALPHA</code>, + <code>GL_RGB</code>, + <code>GL_RGBA</code>, + <code>GL_LUMINANCE</code>, and + <code>GL_LUMINANCE_ALPHA</code>.</p> + </dd> + <dt class='head--doc'><span id='p-type'></span>Parameter <code class='parameter'>type</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the data type of the pixel data. + The following symbolic values are accepted: + <code>GL_UNSIGNED_BYTE</code>, + <code>GL_BYTE</code>, + <code>GL_BITMAP</code>, + <code>GL_UNSIGNED_SHORT</code>, + <code>GL_SHORT</code>, + <code>GL_UNSIGNED_INT</code>, + <code>GL_INT</code>, and + <code>GL_FLOAT</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pixels'></span>Parameter <code class='parameter'>pixels</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to the image data in memory.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_2D</code> + or <code>GL_PROXY_TEXTURE_2D</code>.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>format</i> is not an accepted + format constant. + Format constants other than <code>GL_STENCIL_INDEX</code> and <code>GL_DEPTH_COMPONENT</code> + are accepted.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is not a type constant.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is <code>GL_BITMAP</code> and + <i>format</i> is not <code>GL_COLOR_INDEX</code>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. + .P + .P + <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater than $log + sub 2$<i>max</i>, + where <i>max</i> is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>internalformat</i> is not 1, 2, 3, 4, or one of the + accepted resolution and format symbolic constants.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>width</i> or <i>height</i> is less than 0 + or greater than 2 + <code>GL_MAX_TEXTURE_SIZE</code>, + or if either cannot be represented as 2 sup k + 2("border") for some + integer value of <i>k</i>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>border</i> is not 0 or 1.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glTexImage2D</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glTexParameter</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glTexParameter</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>pname</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>param</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Texture mapping is a technique that applies an image onto an object's surface + as if the image were a decal or cellophane shrink-wrap. + The image is created in texture space, + with an (s, t) coordinate system. + A texture is a one- or two-dimensional image and a set of parameters + that determine how samples are derived from the image.</p> + <p><code>glTexParameter</code> assigns the value or values in <i>params</i> to the texture parameter + specified as <i>pname</i>. + <i>target</i> defines the target texture, + either <code>GL_TEXTURE_1D</code> or <code>GL_TEXTURE_2D</code>. + The following symbols are accepted in <i>pname</i>:</p> + <p><table class='box'> + <tr><td><code>GL_TEXTURE_MIN_FILTER</code> + </td><td>The texture minifying function is used whenever the pixel being textured + maps to an area greater than one texture element. + There are six defined minifying functions. + Two of them use the nearest one or nearest four texture elements + to compute the texture value. + The other four use mipmaps. +  + A mipmap is an ordered set of arrays representing the same image + at progressively lower resolutions. + If the texture has dimensions 2 sup n times 2 sup m, there are +  bold max ( n, m ) + 1 mipmaps. + The first mipmap is the original texture, + with dimensions 2 sup n times 2 sup m. + Each subsequent mipmap has dimensions 2 sup { k - 1 } times 2 sup { l - 1 }, + where 2 sup k times 2 sup l are the dimensions of the previous mipmap, + until either k = 0 or l=0. + At that point, + subsequent mipmaps have dimension 1 times 2 sup { l - 1 } + or 2 sup { k - 1} times 1 until the final mipmap, + which has dimension 1 times 1. + To define the mipmaps, call <code>glTexImage1D</code>, <code>glTexImage2D</code>, + <code>glCopyTexImage1D</code>, or <code>glCopyTexImage2D</code> + with the <i>level</i> argument indicating the order of the mipmaps. + Level 0 is the original texture; + level bold max ( n, m ) is the final 1 times 1 mipmap. +  + <i>params</i> supplies a function for minifying the texture as one of the following: + .RS 10 + </td></tr> + <tr><td><code>GL_NEAREST</code> + </td><td>Returns the value of the texture element that is nearest + (in Manhattan distance) + to the center of the pixel being textured. + </td></tr> + <tr><td><code>GL_LINEAR</code> + </td><td>Returns the weighted average of the four texture elements + that are closest to the center of the pixel being textured. + These can include border texture elements, + depending on the values of <code>GL_TEXTURE_WRAP_S</code> and <code>GL_TEXTURE_WRAP_T</code>, + and on the exact mapping. + </td></tr> + <tr><td><code>GL_NEAREST_MIPMAP_NEAREST</code> + </td><td>Chooses the mipmap that most closely matches the size of the pixel + being textured and uses the <code>GL_NEAREST</code> criterion + (the texture element nearest to the center of the pixel) + to produce a texture value. + </td></tr> + <tr><td><code>GL_LINEAR_MIPMAP_NEAREST</code> + </td><td>Chooses the mipmap that most closely matches the size of the pixel + being textured and uses the <code>GL_LINEAR</code> criterion + (a weighted average of the four texture elements that are closest + to the center of the pixel) + to produce a texture value. + </td></tr> + <tr><td><code>GL_NEAREST_MIPMAP_LINEAR</code> + </td><td>Chooses the two mipmaps that most closely match the size of the pixel + being textured and uses the <code>GL_NEAREST</code> criterion + (the texture element nearest to the center of the pixel) + to produce a texture value from each mipmap. + The final texture value is a weighted average of those two values. + </td></tr> + <tr><td><code>GL_LINEAR_MIPMAP_LINEAR</code> + </td><td>Chooses the two mipmaps that most closely match the size of the pixel + being textured and uses the <code>GL_LINEAR</code> criterion + (a weighted average of the four texture elements that are closest + to the center of the pixel) + to produce a texture value from each mipmap. + The final texture value is a weighted average of those two values. + .RE +  + As more texture elements are sampled in the minification process, + fewer aliasing artifacts will be apparent. + While the <code>GL_NEAREST</code> and <code>GL_LINEAR</code> minification functions can be + faster than the other four, + they sample only one or four texture elements to determine the texture value + of the pixel being rendered and can produce moire patterns + or ragged transitions. + The initial value of <code>GL_TEXTURE_MIN_FILTER</code> is + <code>GL_NEAREST_MIPMAP_LINEAR</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_MAG_FILTER</code> + </td><td>The texture magnification function is used when the pixel being textured + maps to an area less than or equal to one texture element. + It sets the texture magnification function to either <code>GL_NEAREST</code> + or <code>GL_LINEAR</code> (see below). <code>GL_NEAREST</code> is generally faster + than <code>GL_LINEAR</code>, + but it can produce textured images with sharper edges + because the transition between texture elements is not as smooth. + The initial value of <code>GL_TEXTURE_MAG_FILTER</code> is <code>GL_LINEAR</code>. + .RS 10 + </td></tr> + <tr><td><code>GL_NEAREST</code> + </td><td>Returns the value of the texture element that is nearest + (in Manhattan distance) + to the center of the pixel being textured. + </td></tr> + <tr><td><code>GL_LINEAR</code> + </td><td>Returns the weighted average of the four texture elements + that are closest to the center of the pixel being textured. + These can include border texture elements, + depending on the values of <code>GL_TEXTURE_WRAP_S</code> and <code>GL_TEXTURE_WRAP_T</code>, + and on the exact mapping. + </td></tr> + </table> + </p> + <p>.RE</p> + <p><table class='box'> + <tr><td><code>GL_TEXTURE_WRAP_S</code> + </td><td>Sets the wrap parameter for texture coordinate <i>s</i> to either + <code>GL_CLAMP</code> or <code>GL_REPEAT</code>. + <code>GL_CLAMP</code> causes s coordinates to be clamped to the range [0,1] + and is useful for preventing wrapping artifacts when mapping + a single image onto an object. + <code>GL_REPEAT</code> causes the integer part of the s coordinate to be ignored; + the GL uses only the fractional part, + thereby creating a repeating pattern. + Border texture elements are accessed only if wrapping is set to <code>GL_CLAMP</code>. + Initially, <code>GL_TEXTURE_WRAP_S</code> is set to <code>GL_REPEAT</code>. + </td></tr> + </table> + </p> + <p><table class='box'> + <tr><td><code>GL_TEXTURE_WRAP_T</code> + </td><td>Sets the wrap parameter for texture coordinate <i>t</i> to either + <code>GL_CLAMP</code> or <code>GL_REPEAT</code>. + See the discussion under <code>GL_TEXTURE_WRAP_S</code>. + Initially, <code>GL_TEXTURE_WRAP_T</code> is set to <code>GL_REPEAT</code>. + </td></tr> + <tr><td><code>GL_TEXTURE_BORDER_COLOR</code> + </td><td>Sets a border color. + <i>params</i> contains four values that comprise the RGBA color + of the texture border. + Integer color components are interpreted linearly such that the most + positive integer maps to 1.0, + and the most negative integer maps to -1.0. + The values are clamped to the range [0,1] when they are specified. + Initially, the border color is (0, 0, 0, 0). + </td></tr> + <tr><td><code>GL_TEXTURE_PRIORITY</code> + </td><td>Specifies the texture residence priority of the currently bound texture. + Permissible values are in the range [0,\ 1]. + See <code>glPrioritizeTextures</code> and <code>glBindTexture</code> for more information. + </td></tr> + </table> + </p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture, + which must be either <code>GL_TEXTURE_1D</code> or <code>GL_TEXTURE_2D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the symbolic name of a single-valued texture parameter. + <i>pname</i> can be one of the following: + <code>GL_TEXTURE_MIN_FILTER</code>, + <code>GL_TEXTURE_MAG_FILTER</code>, + <code>GL_TEXTURE_WRAP_S</code>, + <code>GL_TEXTURE_WRAP_T</code>, or + <code>GL_TEXTURE_PRIORITY</code>.</p> + </dd> + <dt class='head--doc'><span id='p-param'></span>Parameter <code class='parameter'>param</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the value of <i>pname</i>.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture, + which must be either <code>GL_TEXTURE_1D</code> or <code>GL_TEXTURE_2D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pname'></span>Parameter <code class='parameter'>pname</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the symbolic name of a texture parameter. + <i>pname</i> can be one of the following: + <code>GL_TEXTURE_MIN_FILTER</code>, + <code>GL_TEXTURE_MAG_FILTER</code>, + <code>GL_TEXTURE_WRAP_S</code>, + <code>GL_TEXTURE_WRAP_T</code>, + <code>GL_TEXTURE_BORDER_COLOR</code>, or + <code>GL_TEXTURE_PRIORITY</code>.</p> + </dd> + <dt class='head--doc'><span id='p-params'></span>Parameter <code class='parameter'>params</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array where the value or values of <i>pname</i> are stored.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> or <i>pname</i> is not + one of the accepted defined values.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>params</i> should have a defined + constant value (based on the value of <i>pname</i>) and does not.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glTexParameter</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glTexSubImage2D</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glTexSubImage2D</span>(</b><code class='datatype'>int</code> <code class='argument'>target</code>, <code class='datatype'>int</code> <code class='argument'>level</code>, <code class='datatype'>int</code> <code class='argument'>xoffset</code>, <code class='datatype'>int</code> <code class='argument'>yoffset</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>width</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>height</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>format</code>, <code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>) <code class='argument'>type</code>, <code class='datatype'>array</code>(<code class='datatype'>object</code>|<code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>object</code>)) <code class='argument'>pixels</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Texturing maps a portion of a specified texture image + onto each graphical primitive for which texturing is enabled. + To enable and disable two-dimensional texturing, call <code>glEnable</code> + and <code>glDisable</code> with argument <code>GL_TEXTURE_2D</code>.</p> + <p><code>glTexSubImage2D</code> redefines a contiguous subregion of an existing two-dimensional + texture image. + The texels referenced by <i>pixels</i> replace the portion of the + existing texture array with x indices <i>xoffset</i> and "xoffset"~+~"width"~-~1, + inclusive, + and y indices <i>yoffset</i> and "yoffset"~+~"height"~-~1, inclusive. + This region may not include any texels outside the range of the + texture array as it was originally specified. + It is not an error to specify a subtexture with zero width or height, but + such a specification has no effect.</p> + </dd> + <dt class='head--doc'><span id='p-target'></span>Parameter <code class='parameter'>target</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the target texture. + Must be <code>GL_TEXTURE_2D</code>.</p> + </dd> + <dt class='head--doc'><span id='p-level'></span>Parameter <code class='parameter'>level</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the level-of-detail number. + Level 0 is the base image level. + Level <i>n</i> is the <i>n</i>th mipmap reduction image.</p> + </dd> + <dt class='head--doc'><span id='p-xoffset'></span>Parameter <code class='parameter'>xoffset</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texel offset in the x direction within the texture array.</p> + </dd> + <dt class='head--doc'><span id='p-yoffset'></span>Parameter <code class='parameter'>yoffset</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a texel offset in the y direction within the texture array.</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the width of the texture subimage.</p> + </dd> + <dt class='head--doc'><span id='p-height'></span>Parameter <code class='parameter'>height</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the height of the texture subimage.</p> + </dd> + <dt class='head--doc'><span id='p-format'></span>Parameter <code class='parameter'>format</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the format of the pixel data. + The following symbolic values are accepted: + <code>GL_COLOR_INDEX</code>, + <code>GL_RED</code>, + <code>GL_GREEN</code>, + <code>GL_BLUE</code>, + <code>GL_ALPHA</code>, + <code>GL_RGB</code>, + <code>GL_RGBA</code>, + <code>GL_LUMINANCE</code>, and + <code>GL_LUMINANCE_ALPHA</code>.</p> + </dd> + <dt class='head--doc'><span id='p-type'></span>Parameter <code class='parameter'>type</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies the data type of the pixel data. + The following symbolic values are accepted: + <code>GL_UNSIGNED_BYTE</code>, + <code>GL_BYTE</code>, + <code>GL_BITMAP</code>, + <code>GL_UNSIGNED_SHORT</code>, + <code>GL_SHORT</code>, + <code>GL_UNSIGNED_INT</code>, + <code>GL_INT</code>, and + <code>GL_FLOAT</code>.</p> + </dd> + <dt class='head--doc'><span id='p-pixels'></span>Parameter <code class='parameter'>pixels</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to the image data in memory.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_ENUM</code> is generated if <i>target</i> is not <code>GL_TEXTURE_2D</code>. </p> + <p><code>GL_INVALID_OPERATION</code> is generated if the texture array has not + been defined by a previous <code>glTexImage2D</code> operation.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>level</i> is less than 0. + .P + P + <code>GL_INVALID_VALUE</code> may be generated if <i>level</i> is greater + than log sub 2<i>max</i>, + where <i>max</i> is the returned value of <code>GL_MAX_TEXTURE_SIZE</code>.</p> + <p><code>GL_INVALID_VALUE</code> is generated if "xoffset" ~&lt;~ ~-b, + ("xoffset"~+~"width") ~&gt;~ (w~-~b), + "yoffset" ~&lt;~ ~-b, or ("yoffset" ~+~ "height") ~&gt;~ (h~-~b). + Where w is the <code>GL_TEXTURE_WIDTH</code>, + h is the <code>GL_TEXTURE_HEIGHT</code>, and b is the border width + of the texture image being modified. + Note that w and h include twice the border width.</p> + <p><code>GL_INVALID_VALUE</code> is generated if <i>width</i> or <i>height</i> is less than 0.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>format</i> is not an accepted + format constant.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is not a type constant.</p> + <p><code>GL_INVALID_ENUM</code> is generated if <i>type</i> is <code>GL_BITMAP</code> and + <i>format</i> is not <code>GL_COLOR_INDEX</code>.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glTexSubImage2D</code> is executed + between the execution of <code>glBegin</code> and the corresponding + execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glTranslate</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glTranslate</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>x</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>y</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>z</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glTranslate</code> produces a translation by + ("x","y","z"). + The current matrix + (see </p> + <p><code>glMatrixMode</code>) + is multiplied by this translation matrix, + with the product replacing the current matrix, as if + <code>glMultMatrix</code> were called with the following matrix + for its argument: + .sp + .ce + .EQ + left ( ~ down 20 matrix { +  ccol { 1~~ above 0~~ above 0~~ above 0~~ } +  ccol { 0~~ above 1~~ above 0~~ above 0~~ } +  ccol { 0~~ above 0~~ above 1~~ above 0~~ } +  ccol { "x"~ above "y"~ above "z"~ above 1} + } ~~right ) + .EN + .sp + .RE + If the matrix mode is either <code>GL_MODELVIEW</code> or <code>GL_PROJECTION</code>, + all objects drawn after a call to <code>glTranslate</code> are translated.</p> + <p>Use <code>glPushMatrix</code> and + <code>glPopMatrix</code> to save and restore + the untranslated coordinate system.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the <i>x</i>, <i>y</i>, and <i>z</i> coordinates of a translation vector.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_OPERATION</code> is generated if <code>glTranslate</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glVertex</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glVertex</span>(</b><code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>array</code>(<code class='datatype'>float</code>|<code class='datatype'>int</code>) <code class='argument'>x</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>y</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>z</code>, <code class='datatype'>float</code>|<code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>w</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glVertex</code> commands are used within <code>glBegin</code>/<code>glEnd</code> pairs to specify + point, line, and polygon vertices. + The current color, + normal, + and texture coordinates are associated with the vertex when <code>glVertex</code> is called.</p> + <p>When only <i>x</i> and <i>y</i> are specified, + <i>z</i> defaults to 0 and <i>w</i> defaults to 1. + When <i>x, y,</i> and <i>z</i> are specified, + <i>w</i> defaults to 1.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify <i>x</i>, <i>y</i>, <i>z</i>, and <i>w</i> coordinates of a vertex. + Not all parameters are present in all forms of the command.</p> + </dd> + <dt class='head--doc'><span id='p-v'></span>Parameter <code class='parameter'>v</code></dt> + <dd></dd><dd class='body--doc'><p>Specifies a pointer to an array of two, three, or four elements. + The elements of a two-element array are <i>x</i> and <i>y</i>; + of a three-element array, <i>x</i>, <i>y</i>, and <i>z</i>; + and of a four-element array, <i>x</i>, <i>y</i>, <i>z</i>, and <i>w</i>.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>glViewport</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>glViewport</span>(</b><code class='datatype'>int</code> <code class='argument'>x</code>, <code class='datatype'>int</code> <code class='argument'>y</code>, <code class='datatype'>int</code> <code class='argument'>width</code>, <code class='datatype'>int</code> <code class='argument'>height</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p><code>glViewport</code> specifies the affine transformation of x and y from + normalized device coordinates to window coordinates. + Let (x sub nd, y sub nd) be normalized device coordinates. + Then the window coordinates (x sub w, y sub w) are computed as follows: + .sp + .ce + .EQ + x sub w ~=~ ( x sub nd + 1 ) left ( "width" over 2 right ) ~+~ "x" + .EN + .sp + .ce + .EQ + y sub w ~=~ ( y sub nd + 1 ) left ( "height" over 2 right ) ~+~ "y" + .EN + .RE</p> + <p>Viewport width and height are silently clamped + to a range that depends on the implementation. + To query this range, call <code>glGet</code> with argument + <code>GL_MAX_VIEWPORT_DIMS</code>.</p> + </dd> + <dt class='head--doc'><span id='p-x'></span>Parameter <code class='parameter'>x</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the lower left corner of the viewport rectangle, + in pixels. The initial value is (0,0).</p> + </dd> + <dt class='head--doc'><span id='p-width'></span>Parameter <code class='parameter'>width</code></dt> + <dd></dd><dd class='body--doc'><p>Specify the width and height + of the viewport. + When a GL context is first attached to a window, + <i>width</i> and <i>height</i> are set to the dimensions of that window.</p> + </dd> + <dt class='head--doc'>Throws</dt> + <dd class='body--doc'><p><code>GL_INVALID_VALUE</code> is generated if either <i>width</i> or <i>height</i> is negative.</p> + <p><code>GL_INVALID_OPERATION</code> is generated if <code>glViewport</code> + is executed between the execution of <code>glBegin</code> + and the corresponding execution of <code>glEnd</code>.</p> + </dd></dl> + </dd></dl><dl><dt><h2 class='header'>Module <b class='ms datatype'>GLU</b></h2> + </dt><dd> +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>gluLookAt</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>gluLookAt</span>(</b><code class='datatype'>float</code>|<code class='datatype'>object</code> <code class='argument'>eye</code>, <code class='datatype'>float</code>|<code class='datatype'>object</code> <code class='argument'>center</code>, <code class='datatype'>float</code>|<code class='datatype'>object</code> <code class='argument'>up</code>, <code class='datatype'>float</code> ... <code class='argument'>old_api</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>gluOrtho2D</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>gluOrtho2D</span>(</b><code class='datatype'>float</code> <code class='argument'>left</code>, <code class='datatype'>float</code> <code class='argument'>right</code>, <code class='datatype'>float</code> <code class='argument'>bottom</code>, <code class='datatype'>float</code> <code class='argument'>top</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>gluPerspective</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>gluPerspective</span>(</b><code class='datatype'>float</code> <code class='argument'>fovy</code>, <code class='datatype'>float</code> <code class='argument'>aspect</code>, <code class='datatype'>float</code> <code class='argument'>zNear</code>, <code class='datatype'>float</code> <code class='argument'>zFar</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>gluPickMatrix</b></span> + </dt> + <dd><p><code><code class='datatype'>void</code> <b><span class='method'>gluPickMatrix</span>(</b><code class='datatype'>float</code> <code class='argument'>x</code>, <code class='datatype'>float</code> <code class='argument'>y</code>, <code class='datatype'>float</code> <code class='argument'>width</code>, <code class='datatype'>float</code> <code class='argument'>height</code>, <code class='datatype'>array</code>(<code class='datatype'>int</code>) <code class='argument'>viewport</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>gluProject</b></span> + </dt> + <dd><p><code><code class='datatype'>array</code>(<code class='datatype'>float</code>) <b><span class='method'>gluProject</span>(</b><code class='datatype'>float</code> <code class='argument'>objx</code>, <code class='datatype'>float</code> <code class='argument'>objy</code>, <code class='datatype'>float</code> <code class='argument'>objz</code>, <code class='datatype'>array</code>(<code class='datatype'>float</code>) <code class='argument'>model</code>, <code class='datatype'>array</code>(<code class='datatype'>float</code>) <code class='argument'>proj</code>, <code class='datatype'>array</code>(<code class='datatype'>int</code>) <code class='argument'>viewport</code><b>)</b></code></p></dd> + <dt class='head--fixme'>FIXME</dt> + <dd class='body--fixme'><p>Document this function.</p> + </dd></dl> + </dd></dl></dd></dl></body></html>