GLGETTEXENV(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸ’– GLGETTEXENV β€” bestie, we're getting texture environment params πŸ’–

okay so this is GLGETTEXENV(3G) from the OpenGL manual, section 3G, and it's literally the getter to glTexEnv's setter. no cap. we're pulling texture environment values OUT and putting them in your params array. it's giving "tell me what you set earlier" energy and honestly? iconic.


✨ NAME ✨

glGetTexEnvfv, glGetTexEnviv β€” return texture environment parameters πŸŽ€


🌸 C SPECIFICATION 🌸

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

two functions, same vibe, different types. f for floats, i for ints. pick your fighter πŸ’…


πŸ¦‹ PARAMETERS πŸ¦‹

  • target β€” specifies a texture environment. it must be GL_TEXTURE_ENV. like, that's the only accepted value bestie, don't try anything cute.
  • pname β€” the symbolic name of a texture environment parameter you want. the accepted values are GL_TEXTURE_ENV_MODE and GL_TEXTURE_ENV_COLOR.
  • params β€” returns the requested data. this is where the good stuff lands 🫢

πŸ’œ DESCRIPTION πŸ’œ

glGetTexEnv returns, in params, selected values of a texture environment β€” the same one that was specified with glTexEnv. target specifies a texture environment. and currently? only one texture environment is defined and supported: GL_TEXTURE_ENV. one and only, main character energy πŸ‘‘

pname names a specific texture environment parameter, and here's the tea:

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. when you ask for integer values, they're 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).


🧚 NOTES 🧚

if an error is generated, no change is made to the contents of params. so your array stays exactly as it was β€” no half-written chaos, we love a clean failure πŸ’–

when the GL_ARB_multitexture extension is supported, glGetTexEnv returns the texture environment parameters for the active texture unit. so like, whichever texture unit is the active one? that's who's talking. iykyk ✨


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_ENUM is generated if target or pname is not an accepted value. bestie, read the parameter list, i'm begging 😭
  • GL_INVALID_OPERATION is generated if glGetTexEnv is executed between the execution of glBegin and the corresponding execution of glEnd. do not do this. that's the forbidden window, no getting params mid-primitive, periodt πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

  • glActiveTextureARB(3G)
  • glTexEnv(3G)

okay that's the whole page, you ate it, you understood it, slay πŸŒΈβœ¨πŸ’…

this was GLGETTEXENV(3G) from the 3G manual β€” yes, the footer really just says GLGETTEXENV(3G) again, the manpage was too iconic to write anything else down there πŸ’– go forth and get those texenv params, bestie πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from