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. andtexturehas to be one ofGL_TEXTUREi, where i ranges from zero all the way up to the value ofGL_MAX_COMBINED_TEXTURE_IMAGE_UNITSminus one. the initial value isGL_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 iftextureis not one ofGL_TEXTUREi, where i ranges from zero to the value ofGL_MAX_COMBINED_TEXTURE_IMAGE_UNITSminus one. so like, if you colour outside the lines, it will yell at you π
π ASSOCIATED GETS π
glGet()with argumentGL_ACTIVE_TEXTUREglGet()with argumentGL_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β OpenGL2.0βglActiveTextureβ OpenGL2.1βglActiveTextureβ OpenGL3.0βglActiveTextureβ OpenGL3.1βglActiveTextureβ OpenGL3.2βglActiveTextureβ OpenGL3.3βglActiveTextureβ OpenGL4.0βglActiveTextureβ OpenGL4.1βglActiveTextureβ OpenGL4.2βglActiveTextureβ OpenGL4.3βglActiveTextureβ OpenGL4.4βglActiveTextureβ OpenGL4.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 π
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 (again, yes really) π
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
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms