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=
"glGetTexEnv">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glGetTexEnv
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetTexEnv
</refname>
17 <refpurpose>return texture environment parameters
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetTexEnvfv
</function></funcdef>
23 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
25 <paramdef>GLfloat *
<parameter>params
</parameter></paramdef>
31 <funcdef>void
<function>glGetTexEnviv
</function></funcdef>
32 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
33 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
34 <paramdef>GLint *
<parameter>params
</parameter></paramdef>
38 <refsect1 id=
"parameters"><title>Parameters
</title>
41 <term><parameter>target
</parameter></term>
44 Specifies a texture environment. May be
45 <constant>GL_TEXTURE_ENV
</constant>,
46 <constant>GL_TEXTURE_FILTER_CONTROL
</constant>, or
47 <constant>GL_POINT_SPRITE
</constant>.
52 <term><parameter>pname
</parameter></term>
55 Specifies the symbolic name of a texture environment parameter.
56 Accepted values are
<constant>GL_TEXTURE_ENV_MODE
</constant>,
<constant>GL_TEXTURE_ENV_COLOR
</constant>,
57 <constant>GL_TEXTURE_LOD_BIAS
</constant>,
58 <constant>GL_COMBINE_RGB
</constant>,
59 <constant>GL_COMBINE_ALPHA
</constant>,
60 <constant>GL_SRC0_RGB
</constant>,
61 <constant>GL_SRC1_RGB
</constant>,
62 <constant>GL_SRC2_RGB
</constant>,
63 <constant>GL_SRC0_ALPHA
</constant>,
64 <constant>GL_SRC1_ALPHA
</constant>,
65 <constant>GL_SRC2_ALPHA
</constant>,
66 <constant>GL_OPERAND0_RGB
</constant>,
67 <constant>GL_OPERAND1_RGB
</constant>,
68 <constant>GL_OPERAND2_RGB
</constant>,
69 <constant>GL_OPERAND0_ALPHA
</constant>,
70 <constant>GL_OPERAND1_ALPHA
</constant>,
71 <constant>GL_OPERAND2_ALPHA
</constant>,
72 <constant>GL_RGB_SCALE
</constant>,
73 <constant>GL_ALPHA_SCALE
</constant>, or
74 <constant>GL_COORD_REPLACE
</constant>.
79 <term><parameter>params
</parameter></term>
82 Returns the requested data.
88 <refsect1 id=
"description"><title>Description
</title>
90 <function>glGetTexEnv
</function> returns in
<parameter>params
</parameter> selected values of a texture environment that
91 was specified with
<citerefentry><refentrytitle>glTexEnv
</refentrytitle></citerefentry>.
92 <parameter>target
</parameter> specifies a texture environment.
95 When
<parameter>target
</parameter> is
<constant>GL_TEXTURE_FILTER_CONTROL
</constant>,
96 <parameter>pname
</parameter> must be
<constant>GL_TEXTURE_LOD_BIAS
</constant>.
97 When
<parameter>target
</parameter> is
<constant>GL_POINT_SPRITE
</constant>,
98 <parameter>pname
</parameter> must be
<constant>GL_COORD_REPLACE
</constant>.
99 When
<parameter>target
</parameter> is
100 <constant>GL_TEXTURE_ENV
</constant>,
<parameter>pname
</parameter> can be
<constant>GL_TEXTURE_ENV_MODE
</constant>,
101 <constant>GL_TEXTURE_ENV_COLOR
</constant>,
<constant>GL_COMBINE_RGB
</constant>,
<constant>GL_COMBINE_ALPHA
</constant>,
102 <constant>GL_RGB_SCALE
</constant>,
<constant>GL_ALPHA_SCALE
</constant>,
103 <constant>GL_SRC0_RGB
</constant>,
<constant>GL_SRC1_RGB
</constant>,
<constant>GL_SRC2_RGB
</constant>,
104 <constant>GL_SRC0_ALPHA
</constant>,
<constant>GL_SRC1_ALPHA
</constant>, or
<constant>GL_SRC2_ALPHA
</constant>.
107 <parameter>pname
</parameter> names a specific texture environment parameter, as follows:
111 <term><constant>GL_TEXTURE_ENV_MODE
</constant></term>
114 <parameter>params
</parameter> returns the single-valued texture environment mode,
115 a symbolic constant. The initial value is
<constant>GL_MODULATE
</constant>.
120 <term><constant>GL_TEXTURE_ENV_COLOR
</constant></term>
123 <parameter>params
</parameter> returns four integer or floating-point values that are the
124 texture environment color.
127 are linearly mapped from the internal floating-point representation
128 such that
1.0 maps to the most positive representable integer,
130 <inlineequation><mml:math>
132 <mml:mn>-
1.0</mml:mn>
133 </mml:math></inlineequation>
134 maps to the most negative representable integer. The initial
135 value is (
0,
0,
0,
0).
140 <term><constant>GL_TEXTURE_LOD_BIAS
</constant></term>
143 <parameter>params
</parameter> returns a single floating-point value that is the texture
144 level-of-detail bias. The initial value is
0.
149 <term><constant>GL_COMBINE_RGB
</constant></term>
152 <parameter>params
</parameter> returns a single symbolic constant value representing the current
153 RGB combine mode. The initial value is
<constant>GL_MODULATE
</constant>.
158 <term><constant>GL_COMBINE_ALPHA
</constant></term>
161 <parameter>params
</parameter> returns a single symbolic constant value representing the current
162 alpha combine mode. The initial value is
<constant>GL_MODULATE
</constant>.
167 <term><constant>GL_SRC0_RGB
</constant></term>
170 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
171 combiner zero's RGB source. The initial value is
<constant>GL_TEXTURE
</constant>.
176 <term><constant>GL_SRC1_RGB
</constant></term>
179 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
180 combiner one's RGB source. The initial value is
<constant>GL_PREVIOUS
</constant>.
185 <term><constant>GL_SRC2_RGB
</constant></term>
188 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
189 combiner two's RGB source. The initial value is
<constant>GL_CONSTANT
</constant>.
194 <term><constant>GL_SRC0_ALPHA
</constant></term>
197 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
198 combiner zero's alpha source. The initial value is
<constant>GL_TEXTURE
</constant>.
203 <term><constant>GL_SRC1_ALPHA
</constant></term>
206 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
207 combiner one's alpha source. The initial value is
<constant>GL_PREVIOUS
</constant>.
212 <term><constant>GL_SRC2_ALPHA
</constant></term>
215 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
216 combiner two's alpha source. The initial value is
<constant>GL_CONSTANT
</constant>.
221 <term><constant>GL_OPERAND0_RGB
</constant></term>
224 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
225 combiner zero's RGB operand. The initial value is
<constant>GL_SRC_COLOR
</constant>.
230 <term><constant>GL_OPERAND1_RGB
</constant></term>
233 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
234 combiner one's RGB operand. The initial value is
<constant>GL_SRC_COLOR
</constant>.
239 <term><constant>GL_OPERAND2_RGB
</constant></term>
242 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
243 combiner two's RGB operand. The initial value is
<constant>GL_SRC_ALPHA
</constant>.
248 <term><constant>GL_OPERAND0_ALPHA
</constant></term>
251 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
252 combiner zero's alpha operand. The initial value is
<constant>GL_SRC_ALPHA
</constant>.
257 <term><constant>GL_OPERAND1_ALPHA
</constant></term>
260 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
261 combiner one's alpha operand. The initial value is
<constant>GL_SRC_ALPHA
</constant>.
266 <term><constant>GL_OPERAND2_ALPHA
</constant></term>
269 <parameter>params
</parameter> returns a single symbolic constant value representing the texture
270 combiner two's alpha operand. The initial value is
<constant>GL_SRC_ALPHA
</constant>.
275 <term><constant>GL_RGB_SCALE
</constant></term>
278 <parameter>params
</parameter> returns a single floating-point value representing the current RGB
279 texture combiner scaling factor. The initial value is
1.0.
284 <term><constant>GL_ALPHA_SCALE
</constant></term>
287 <parameter>params
</parameter> returns a single floating-point value representing the current alpha
288 texture combiner scaling factor. The initial value is
1.0.
293 <term><constant>GL_COORD_REPLACE
</constant></term>
296 <parameter>params
</parameter> returns a single boolean value representing the current point sprite
297 texture coordinate replacement enable state. The initial value is
<constant>GL_FALSE
</constant>.
303 <refsect1 id=
"notes"><title>Notes
</title>
305 If an error is generated,
306 no change is made to the contents of
<parameter>params
</parameter>.
309 For OpenGL versions
1.3 and greater, or when the
<code>ARB_multitexture
</code> extension is supported,
<function>glGetTexEnv
</function> returns
310 the texture environment parameters for the active texture unit.
313 <constant>GL_COMBINE_RGB
</constant>,
314 <constant>GL_COMBINE_ALPHA
</constant>,
315 <constant>GL_SRC0_RGB
</constant>,
316 <constant>GL_SRC1_RGB
</constant>,
317 <constant>GL_SRC2_RGB
</constant>,
318 <constant>GL_SRC0_ALPHA
</constant>,
319 <constant>GL_SRC1_ALPHA
</constant>,
320 <constant>GL_SRC2_ALPHA
</constant>,
321 <constant>GL_OPERAND0_RGB
</constant>,
322 <constant>GL_OPERAND1_RGB
</constant>,
323 <constant>GL_OPERAND2_RGB
</constant>,
324 <constant>GL_OPERAND0_ALPHA
</constant>,
325 <constant>GL_OPERAND1_ALPHA
</constant>,
326 <constant>GL_OPERAND2_ALPHA
</constant>,
327 <constant>GL_RGB_SCALE
</constant>, and
328 <constant>GL_ALPHA_SCALE
</constant> are available only if the GL version is
1.3 or greater.
331 <constant>GL_TEXTURE_FILTER_CONTROL
</constant> and
<constant>GL_TEXTURE_LOD_BIAS
</constant> are available
332 only if the GL version is
1.4 or greater.
335 <constant>GL_POINT_SPRITE
</constant> and
<constant>GL_COORD_REPLACE
</constant> are available
336 only if the GL version is
2.0 or greater.
339 <refsect1 id=
"errors"><title>Errors
</title>
341 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>target
</parameter> or
<parameter>pname
</parameter> is not an
345 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glGetTexEnv
</function>
346 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
347 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
350 <refsect1 id=
"seealso"><title>See Also
</title>
352 <citerefentry><refentrytitle>glActiveTexture
</refentrytitle></citerefentry>,
353 <citerefentry><refentrytitle>glTexEnv
</refentrytitle></citerefentry>
356 <refsect1 id=
"Copyright"><title>Copyright
</title>
358 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
359 Silicon Graphics, Inc. This document is licensed under the SGI
360 Free Software B License. For details, see
361 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.