1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glFogCoordPointer">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glFogCoordPointer
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glFogCoordPointer
</refname>
17 <refpurpose>define an array of fog coordinates
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glFogCoordPointer
</function></funcdef>
23 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
24 <paramdef>GLsizei
<parameter>stride
</parameter></paramdef>
25 <paramdef>GLvoid *
<parameter>pointer
</parameter></paramdef>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id=
"parameters"><title>Parameters
</title>
33 <term><parameter>type
</parameter></term>
36 Specifies the data type of each fog coordinate.
38 <constant>GL_FLOAT
</constant>,
39 or
<constant>GL_DOUBLE
</constant>
40 are accepted. The initial value is
<constant>GL_FLOAT
</constant>.
45 <term><parameter>stride
</parameter></term>
48 Specifies the byte offset between consecutive fog coordinates.
49 If
<parameter>stride
</parameter> is
0, the array elements are understood
50 to be tightly packed. The initial value is
0.
55 <term><parameter>pointer
</parameter></term>
58 Specifies a pointer to the first coordinate of the first fog coordinate in the
59 array. The initial value is
0.
65 <refsect1 id=
"description"><title>Description
</title>
67 <function>glFogCoordPointer
</function> specifies the location and data format of an array of fog coordinates
68 to use when rendering.
<parameter>type
</parameter> specifies the data type of each fog
69 coordinate, and
<parameter>stride
</parameter> specifies the byte stride from one fog coordinate to
70 the next, allowing vertices and attributes to be packed into a single array
71 or stored in separate arrays.
74 If a non-zero named buffer object is bound to the
<constant>GL_ARRAY_BUFFER
</constant> target
75 (see
<citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>) while a fog coordinate array is
76 specified,
<parameter>pointer
</parameter> is treated as a byte offset into the buffer object's data store.
77 Also, the buffer object binding (
<constant>GL_ARRAY_BUFFER_BINDING
</constant>) is saved as fog coordinate vertex array
78 client-side state (
<constant>GL_FOG_COORD_ARRAY_BUFFER_BINDING
</constant>).
81 When a fog coordinate array is specified,
82 <parameter>type
</parameter>,
<parameter>stride
</parameter>, and
<parameter>pointer
</parameter> are saved as client-side
83 state, in addition to the current vertex array buffer object binding.
86 To enable and disable the fog coordinate array, call
87 <citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry> with the argument
88 <constant>GL_FOG_COORD_ARRAY
</constant>. If
89 enabled, the fog coordinate array is used
90 when
<citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
91 <citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>, or
92 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry> is called.
95 <refsect1 id=
"notes"><title>Notes
</title>
97 <function>glFogCoordPointer
</function> is available only if the GL version is
1.4 or greater.
100 Fog coordinates are not supported for interleaved vertex array formats
101 (see
<citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>).
104 The fog coordinate array is initially disabled and isn't accessed when
105 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
106 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>
110 Execution of
<function>glFogCoordPointer
</function> is not allowed between the execution of
111 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry> and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>,
112 but an error may or may not be generated. If no error is generated,
113 the operation is undefined.
116 <function>glFogCoordPointer
</function> is typically implemented on the client side with no protocol.
119 Fog coordinate array parameters are client-side state and are
120 therefore not saved or restored by
<citerefentry><refentrytitle>glPushAttrib
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glPopAttrib
</refentrytitle></citerefentry>.
121 Use
<citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry> and
122 <citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry> instead.
125 <refsect1 id=
"errors"><title>Errors
</title>
127 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>type
</parameter> is not either
<constant>GL_FLOAT
</constant>
128 or
<constant>GL_DOUBLE
</constant>.
131 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>stride
</parameter> is negative.
134 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
136 <citerefentry><refentrytitle>glIsEnabled
</refentrytitle></citerefentry> with argument
<constant>GL_FOG_COORD_ARRAY
</constant>
139 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_FOG_COORD_ARRAY_STRIDE
</constant>
142 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_FOG_COORD_ARRAY_TYPE
</constant>
145 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_FOG_COORD_ARRAY_BUFFER_BINDING
</constant>
148 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_ARRAY_BUFFER_BINDING
</constant>
151 <citerefentry><refentrytitle>glGetPointerv
</refentrytitle></citerefentry> with argument
<constant>GL_FOG_COORD_ARRAY_POINTER
</constant>
154 <refsect1 id=
"seealso"><title>See Also
</title>
156 <citerefentry><refentrytitle>glArrayElement
</refentrytitle></citerefentry>,
157 <citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>,
158 <citerefentry><refentrytitle>glColorPointer
</refentrytitle></citerefentry>,
159 <citerefentry><refentrytitle>glDisableClientState
</refentrytitle></citerefentry>,
160 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
161 <citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
162 <citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
163 <citerefentry><refentrytitle>glEdgeFlagPointer
</refentrytitle></citerefentry>,
164 <citerefentry><refentrytitle>glEnableClientState
</refentrytitle></citerefentry>,
165 <citerefentry><refentrytitle>glFogCoord
</refentrytitle></citerefentry>,
166 <citerefentry><refentrytitle>glIndexPointer
</refentrytitle></citerefentry>,
167 <citerefentry><refentrytitle>glInterleavedArrays
</refentrytitle></citerefentry>,
168 <citerefentry><refentrytitle>glMultiDrawArrays
</refentrytitle></citerefentry>,
169 <citerefentry><refentrytitle>glMultiDrawElements
</refentrytitle></citerefentry>,
170 <citerefentry><refentrytitle>glNormalPointer
</refentrytitle></citerefentry>,
171 <citerefentry><refentrytitle>glPopClientAttrib
</refentrytitle></citerefentry>,
172 <citerefentry><refentrytitle>glPushClientAttrib
</refentrytitle></citerefentry>,
173 <citerefentry><refentrytitle>glSecondaryColorPointer
</refentrytitle></citerefentry>,
174 <citerefentry><refentrytitle>glTexCoordPointer
</refentrytitle></citerefentry>,
175 <citerefentry><refentrytitle>glVertexAttribPointer
</refentrytitle></citerefentry>,
176 <citerefentry><refentrytitle>glVertexPointer
</refentrytitle></citerefentry>
179 <refsect1 id=
"Copyright"><title>Copyright
</title>
181 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
182 Silicon Graphics, Inc. This document is licensed under the SGI
183 Free Software B License. For details, see
184 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.