GLACTIVETEXTURE(3G)

✨ GLACTIVETEXTURE (3G) β€” the one where you pick your texture unit ✨

okay so real talk, this is page GLACTIVETEXTURE from manual section 3G, and it's genuinely one of the shorter ones but it's so important bestie, don't skip it 🫢


🌸 NAME 🌸

glActiveTexture β€” select the active texture unit. that's it. that's the whole job. iconic behavior honestly πŸ’…


πŸŽ€ C SPECIFICATION πŸŽ€

void glActiveTexture(GLenum texture);

like, that's the signature. memorise it. it's two words and a parameter, you've got this πŸ’–


πŸ¦‹ PARAMETERS πŸ¦‹

  • texture β€” which texture unit you're making the active one, bestie. the number of texture units is implementation dependent, but it must be at least 80. and texture has to be one of GL_TEXTUREi, where i ranges from zero all the way up to the value of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS minus one. the initial value is GL_TEXTURE0 πŸ‘‘
fr fr, at least 80 texture units. your implementation might give you more, but it can never give you fewer. no cap.

πŸ’œ DESCRIPTION πŸ’œ

so glActiveTexture selects which texture unit all your subsequent texture state calls are gonna affect. it's the "who am I talking to right now" of OpenGL 🌈

the number of texture units an implementation supports is implementation dependent, but again β€” must be at least 80. got it? at least 80. always. 🧚


πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_ENUM β€” gets generated if texture is not one of GL_TEXTUREi, where i ranges from zero to the value of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS minus one. so like, if you colour outside the lines, it will yell at you 😭

🌟 ASSOCIATED GETS 🌟

  • glGet() with argument GL_ACTIVE_TEXTURE
  • glGet() with argument GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS

πŸ‘‘ VERSION SUPPORT πŸ‘‘

the vibe check on this one: glActiveTexture shows up in every listed version, full sweep, ate and left no crumbs πŸ’€βœ¨

  • glActiveTexture β€” OpenGL 2.0 βœ”
  • glActiveTexture β€” OpenGL 2.1 βœ”
  • glActiveTexture β€” OpenGL 3.0 βœ”
  • glActiveTexture β€” OpenGL 3.1 βœ”
  • glActiveTexture β€” OpenGL 3.2 βœ”
  • glActiveTexture β€” OpenGL 3.3 βœ”
  • glActiveTexture β€” OpenGL 4.0 βœ”
  • glActiveTexture β€” OpenGL 4.1 βœ”
  • glActiveTexture β€” OpenGL 4.2 βœ”
  • glActiveTexture β€” OpenGL 4.3 βœ”
  • glActiveTexture β€” OpenGL 4.4 βœ”
  • glActiveTexture β€” OpenGL 4.5 βœ”

(it's the function row; the columns are OpenGL 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5 β€” and yes, that's a checkmark in every single one 🫢)


πŸ“ SEE ALSO πŸ“

go read these next, bestie, they're all in the same friend group πŸ’–

  • glGenTextures()
  • glBindTexture()
  • glCompressedTexImage1D()
  • glCompressedTexImage2D()
  • glCompressedTexImage3D()
  • glCompressedTexSubImage1D()
  • glCompressedTexSubImage2D()
  • glCompressedTexSubImage3D()
  • glCopyTexImage1D()
  • glCopyTexImage2D()
  • glCopyTexSubImage1D()
  • glCopyTexSubImage2D()
  • glCopyTexSubImage3D()
  • glDeleteTextures() glIsTexture()
  • glTexImage1D()
  • glTexImage2D()
  • glTexImage2DMultisample()
  • glTexImage3D()
  • glTexImage3DMultisample()
  • glTexSubImage1D()
  • glTexSubImage2D()
  • glTexSubImage3D()
  • glTexParameter(),

Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group.

This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/. (that's the license, don't lose it, it's important πŸ”’)


Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group


and that's the page!! source version is [FIXME: source], dated 08/09/2021, manual GLACTIVETEXTURE(3G) β€” so go forth and select your texture units responsibly, mwah πŸ’‹πŸŒΈβœ¨

πŸ“¦ where this page comes from