GlTexParameter

From QB64 Wiki
Jump to navigation Jump to search

_glTexParameter: set texture parameters


Syntax

 SUB _glTexParameterf (BYVAL target AS _UNSIGNED LONG, BYVAL pname AS _UNSIGNED LONG, BYVAL param AS SINGLE)
 void _glTexParameterf(GLenum target, GLenum pname, GLfloat param);
 SUB _glTexParameteri (BYVAL target AS _UNSIGNED LONG, BYVAL pname AS _UNSIGNED LONG, BYVAL param AS LONG)
 void _glTexParameteri(GLenum target, GLenum pname, GLint param);


target
Specifies the target texture, which must be either _GL_TEXTURE_1D, _GL_TEXTURE_2D, _GL_TEXTURE_3D, _GL_TEXTURE_1D_ARRAY, _GL_TEXTURE_2D_ARRAY, _GL_TEXTURE_RECTANGLE, or _GL_TEXTURE_CUBE_MAP.
pname
Specifies the symbolic name of a single-valued texture parameter. pname can be one of the following: _GL_DEPTH_STENCIL_TEXTURE_MODE, _GL_TEXTURE_BASE_LEVEL, _GL_TEXTURE_COMPARE_FUNC, _GL_TEXTURE_COMPARE_MODE, _GL_TEXTURE_LOD_BIAS, _GL_TEXTURE_MIN_FILTER, _GL_TEXTURE_MAG_FILTER, _GL_TEXTURE_MIN_LOD, _GL_TEXTURE_MAX_LOD, _GL_TEXTURE_MAX_LEVEL, _GL_TEXTURE_SWIZZLE_R, _GL_TEXTURE_SWIZZLE_G, _GL_TEXTURE_SWIZZLE_B, _GL_TEXTURE_SWIZZLE_A, _GL_TEXTURE_WRAP_S, _GL_TEXTURE_WRAP_T, or _GL_TEXTURE_WRAP_R.
param
Specifies the value of pname.


Syntax

 SUB _glTexParameterfv (BYVAL target AS _UNSIGNED LONG, BYVAL pname AS _UNSIGNED LONG, params AS SINGLE)
 void _glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params);
 SUB _glTexParameteriv (BYVAL target AS _UNSIGNED LONG, BYVAL pname AS _UNSIGNED LONG, params AS LONG)
 void _glTexParameteriv(GLenum target, GLenum pname, const GLint * params);
 void _glTexParameterIiv(GLenum target, GLenum pname, const GLint * params);
 void _glTexParameterIuiv(GLenum target, GLenum pname, const GLuint * params);
target
Specifies the target texture, which must be either _GL_TEXTURE_1D, _GL_TEXTURE_2D, _GL_TEXTURE_3D, _GL_TEXTURE_1D_ARRAY, _GL_TEXTURE_2D_ARRAY, _GL_TEXTURE_RECTANGLE, or _GL_TEXTURE_CUBE_MAP.
pname
Specifies the symbolic name of a texture parameter. pname can be one of the following: _GL_DEPTH_STENCIL_TEXTURE_MODE, _GL_TEXTURE_BASE_LEVEL, _GL_TEXTURE_BORDER_COLOR, _GL_TEXTURE_COMPARE_FUNC, _GL_TEXTURE_COMPARE_MODE, _GL_TEXTURE_LOD_BIAS, _GL_TEXTURE_MIN_FILTER, _GL_TEXTURE_MAG_FILTER, _GL_TEXTURE_MIN_LOD, _GL_TEXTURE_MAX_LOD, _GL_TEXTURE_MAX_LEVEL, _GL_TEXTURE_SWIZZLE_R, _GL_TEXTURE_SWIZZLE_G, _GL_TEXTURE_SWIZZLE_B, _GL_TEXTURE_SWIZZLE_A, _GL_TEXTURE_SWIZZLE_RGBA, _GL_TEXTURE_WRAP_S, _GL_TEXTURE_WRAP_T, or _GL_TEXTURE_WRAP_R.
params
Specifies a pointer to an array where the value or values of pname are stored.


Description

_glTexParameter assigns the value or values in params to the texture parameter specified as pname. target defines the target texture, either _GL_TEXTURE_1D, _GL_TEXTURE_2D, _GL_TEXTURE_1D_ARRAY, _GL_TEXTURE_2D_ARRAY, _GL_TEXTURE_RECTANGLE, or _GL_TEXTURE_3D. The following symbols are accepted in pname:

_GL_DEPTH_STENCIL_TEXTURE_MODE
Specifies the mode used to read from depth-stencil format textures. params must be one of _GL_DEPTH_COMPONENT or _GL_STENCIL_COMPONENT. If the depth stencil mode is _GL_DEPTH_COMPONENT, then reads from depth-stencil format textures will return the depth component of the texel in <!--Missing Equation--> and the stencil component will be discarded. If the depth stencil mode is _GL_STENCIL_COMPONENT then the stencil component is returned in <!--Missing Equation--> and the depth component is discarded. The initial value is _GL_DEPTH_COMPONENT.
_GL_TEXTURE_BASE_LEVEL
Specifies the index of the lowest defined mipmap level. This is an integer value. The initial value is 0.
_GL_TEXTURE_MAX_LEVEL
Sets the index of the highest defined mipmap level. This is an integer value. The initial value is 1000.
_GL_TEXTURE_SWIZZLE_R
Sets the swizzle that will be applied to the r component of a texel before it is returned to the shader. Valid values for param are _GL_RED, _GL_GREEN, _GL_BLUE, _GL_ALPHA, _GL_ZERO and _GL_ONE. If _GL_TEXTURE_SWIZZLE_R is _GL_RED, the value for r will be taken from the first channel of the fetched texel. If _GL_TEXTURE_SWIZZLE_R is _GL_GREEN, the value for r will be taken from the second channel of the fetched texel. If _GL_TEXTURE_SWIZZLE_R is _GL_BLUE, the value for r will be taken from the third channel of the fetched texel. If _GL_TEXTURE_SWIZZLE_R is _GL_ALPHA, the value for r will be taken from the fourth channel of the fetched texel. If _GL_TEXTURE_SWIZZLE_R is _GL_ZERO, the value for r will be substituted with 0.0. If _GL_TEXTURE_SWIZZLE_R is _GL_ONE, the value for r will be substituted with 1.0. The initial value is _GL_RED.
_GL_TEXTURE_SWIZZLE_G
Sets the swizzle that will be applied to the g component of a texel before it is returned to the shader. Valid values for param and their effects are similar to those of _GL_TEXTURE_SWIZZLE_R. The initial value is _GL_GREEN.
_GL_TEXTURE_SWIZZLE_B
Sets the swizzle that will be applied to the b component of a texel before it is returned to the shader. Valid values for param and their effects are similar to those of _GL_TEXTURE_SWIZZLE_R. The initial value is _GL_BLUE.
_GL_TEXTURE_SWIZZLE_A
Sets the swizzle that will be applied to the a component of a texel before it is returned to the shader. Valid values for param and their effects are similar to those of _GL_TEXTURE_SWIZZLE_R. The initial value is _GL_ALPHA.
_GL_TEXTURE_SWIZZLE_RGBA
Sets the swizzles that will be applied to the r, g, b, and a components of a texel before they are returned to the shader. Valid values for params and their effects are similar to those of _GL_TEXTURE_SWIZZLE_R, except that all channels are specified simultaneously. Setting the value of _GL_TEXTURE_SWIZZLE_RGBA is equivalent (assuming no errors are generated) to setting the parameters of each of _GL_TEXTURE_SWIZZLE_R, _GL_TEXTURE_SWIZZLE_G, _GL_TEXTURE_SWIZZLE_B, and _GL_TEXTURE_SWIZZLE_A successively.

Template:Glapi sampler parameters


Notes:

Suppose that a program attempts to sample from a texture and has set _GL_TEXTURE_MIN_FILTER to one of the functions that requires a mipmap. If either the dimensions of the texture images currently defined (with previous calls to _glTexImage1D, _glTexImage2D, _glTexImage3D, _glCopyTexImage1D, or _glCopyTexImage2D) do not follow the proper sequence for mipmaps (described above), or there are fewer texture images defined than are needed, or the set of texture images have differing numbers of texture components, then the texture is considered incomplete.

Linear filtering accesses the four nearest texture elements only in 2D textures. In 1D textures, linear filtering accesses the two nearest texture elements. In 3D textures, linear filtering accesses the eight nearest texture elements.

_glTexParameter specifies the texture parameters for the active texture unit, specified by calling _glActiveTexture.

_GL_DEPTH_STENCIL_TEXTURE_MODE is available only if the GL version is 4.3 or greater.


Errors

_GL_INVALID_ENUM is generated if target or pname is not one of the accepted defined values.

_GL_INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not.


Use With:

_glGetTexParameter

_glGetTexLevelParameter


See also

SUB _GL _glActiveTexture, _glBindTexture, _glSamplerParameter


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



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page

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