# glTexParameteri

Definition: | include pGUI.e include opengl.e glTexParameteri(integer target, pname, param)
Description: | Sets texture parameters.
pwa/p2js: | Supported.
Remarks | target: The target texture, which must be either GL_TEXTURE_1D or GL_TEXTURE_2D.
pname | param
--- | ---
| GL_TEXTURE_MIN_FILTER/GL_TEXTURE_MAG_FILTER | GL_NEAREST/GL_LINEAR
| GL_TEXTURE_WRAP_S/GL_TEXTURE_WRAP_T | GL_CLAMP/GL_REPEAT

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.
The glTexParameter function assigns the value or values in params to the texture parameter specified as pname.
The target parameter defines the target texture, either GL_TEXTURE_1D or GL_TEXTURE_2D.
As more texture elements are sampled in the minification process, fewer aliasing artifacts will be apparent.
While the GL_NEAREST and GL_LINEAR 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 default value of GL_TEXTURE_MIN_FILTER is GL_NEAREST_MIPMAP_LINEAR.
Suppose that texturing is enabled (by calling glEnable with argument GL_TEXTURE_1D or GL_TEXTURE_2D) and GL_TEXTURE_MIN_FILTER is set to one of the functions that requires a mipmap. If either the dimensions of the texture images currently defined (with previous calls to glTexImage1D or glTexImage2Dc) do not follow the proper sequence for mipmaps, or there are fewer texture images defined than are needed, or the set of texture images have differing numbers of texture components, then it is as if texture mapping were disabled.
Linear filtering accesses the four nearest texture elements only in 2-D textures.
In 1-D textures, linear filtering accesses the two nearest texture elements.
No error is returned, but on failure the following error codes can be retrieved by glGetError():
GL_INVALID_ENUM- target/pname/param unacceptable.
GL_INVALID_OPERATION - glBegin/glEnd in progress.
Note: This has been simplified by removing all "mipmap" handling (since I don’t have any examples of that).
The C routines glTexParameterf(), glTexParameterfv(), and glTexParameteriv() are not currently wrapped ("").
The following function retrieves information related to glTexParameterf, glTexParameteri, glTexParameterfv, and glTexParameteriv.
glGetTexParameter
See Also: glBegin, glBindTexture, glTexImage2Dc, glEnd
[DEV]See also //glBegin //glBindTexture glCopyPixels glCopyTexImage1D glCopyTexImage2D glCopyTexSubImage2D glDrawPixels //glEnd glGetTexParameter glPixelStore glPixelTransfer glPrioritizeTextures glTexEnv glTexGen glTexImage1D //glTexImage2D glTexSubImage1D glTexSubImage2D