Name

glGetTexEnv — return texture environment parameters

C Specification

void glGetTexEnvfv(GLenum target,
 GLenum pname,
 GLfloat * params);
 
void glGetTexEnviv(GLenum target,
 GLenum pname,
 GLint * params);
 
void glGetTexEnvxv(GLenum target,
 GLenum pname,
 GLfixed * params);
 

Parameters

target

Specifies a texture environment. May be GL_TEXTURE_ENV or GL_POINT_SPRITE_OES.

pname

Specifies the symbolic name of a texture environment parameter. Accepted values are GL_TEXTURE_ENV_MODE, GL_TEXTURE_ENV_COLOR, GL_COMBINE_RGB, GL_COMBINE_ALPHA, GL_SRC0_RGB, GL_SRC1_RGB, GL_SRC2_RGB, GL_SRC0_ALPHA, GL_SRC1_ALPHA, GL_SRC2_ALPHA, GL_OPERAND0_RGB, GL_OPERAND1_RGB, GL_OPERAND2_RGB, GL_OPERAND0_ALPHA, GL_OPERAND1_ALPHA, GL_OPERAND2_ALPHA, GL_RGB_SCALE, GL_ALPHA_SCALE, or GL_COORD_REPLACE_OES.

params

Returns the requested data.

Description

glGetTexEnv returns in params selected values of a texture environment that was specified with glTexEnv. target specifies a texture environment.

When target is GL_POINT_SPRITE_OES, pname must be GL_COORD_REPLACE_OES. When target is GL_TEXTURE_ENV, pname can be GL_TEXTURE_ENV_MODE, GL_TEXTURE_ENV_COLOR, GL_COMBINE_RGB, GL_COMBINE_ALPHA, GL_RGB_SCALE, GL_ALPHA_SCALE, GL_OPERAND0_RGB, GL_OPERAND1_RGB, GL_OPERAND2_RGB, GL_OPERAND0_ALPHA, GL_OPERAND1_ALPHA, GL_OPERAND2_ALPHA, GL_SRC0_RGB, GL_SRC1_RGB, GL_SRC2_RGB, GL_SRC0_ALPHA, GL_SRC1_ALPHA, or GL_SRC2_ALPHA.

pname names a specific texture environment parameter, as follows:

GL_TEXTURE_ENV_MODE

params returns the single-valued texture environment mode, a symbolic constant. The initial value is GL_MODULATE.

GL_TEXTURE_ENV_COLOR

params returns four integer or floating-point values that are the texture environment color. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer, and -1.0 maps to the most negative representable integer. The initial value is (0, 0, 0, 0).

GL_COMBINE_RGB

params returns a single symbolic constant value representing the current RGB combine mode. The initial value is GL_MODULATE.

GL_COMBINE_ALPHA

params returns a single symbolic constant value representing the current alpha combine mode. The initial value is GL_MODULATE.

GL_SRC0_RGB

params returns a single symbolic constant value representing the texture combiner zero's RGB source. The initial value is GL_TEXTURE.

GL_SRC1_RGB

params returns a single symbolic constant value representing the texture combiner one's RGB source. The initial value is GL_PREVIOUS.

GL_SRC2_RGB

params returns a single symbolic constant value representing the texture combiner two's RGB source. The initial value is GL_CONSTANT.

GL_SRC0_ALPHA

params returns a single symbolic constant value representing the texture combiner zero's alpha source. The initial value is GL_TEXTURE.

GL_SRC1_ALPHA

params returns a single symbolic constant value representing the texture combiner one's alpha source. The initial value is GL_PREVIOUS.

GL_SRC2_ALPHA

params returns a single symbolic constant value representing the texture combiner two's alpha source. The initial value is GL_CONSTANT.

GL_OPERAND0_RGB

params returns a single symbolic constant value representing the texture combiner zero's RGB operand. The initial value is GL_SRC_COLOR.

GL_OPERAND1_RGB

params returns a single symbolic constant value representing the texture combiner one's RGB operand. The initial value is GL_SRC_COLOR.

GL_OPERAND2_RGB

params returns a single symbolic constant value representing the texture combiner two's RGB operand. The initial value is GL_SRC_ALPHA.

GL_OPERAND0_ALPHA

params returns a single symbolic constant value representing the texture combiner zero's alpha operand. The initial value is GL_SRC_ALPHA.

GL_OPERAND1_ALPHA

params returns a single symbolic constant value representing the texture combiner one's alpha operand. The initial value is GL_SRC_ALPHA.

GL_OPERAND2_ALPHA

params returns a single symbolic constant value representing the texture combiner two's alpha operand. The initial value is GL_SRC_ALPHA.

GL_RGB_SCALE

params returns a single floating-point value representing the current RGB texture combiner scaling factor. The initial value is 1.0.

GL_ALPHA_SCALE

params returns a single floating-point value representing the current alpha texture combiner scaling factor. The initial value is 1.0.

GL_COORD_REPLACE_OES

params returns a single boolean value representing the current point sprite texture coordinate replacement enable state. The initial value is GL_FALSE.

Notes

If an error is generated, no change is made to the contents of params.

glGetTexEnv returns the texture environment parameters for the active texture unit.

GL_POINT_SPRITE_OES and GL_COORD_REPLACE_OES are available only if the OpenGL ES version is 1.1 or greater.

Errors

GL_INVALID_ENUM is generated if target or pname is not an accepted value.

See Also

glActiveTexture, glTexEnv

Copyright

Copyright © 2003-2004 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.