GLCREATETEXTURES(3G)

πŸ’… GLCREATETEXTURES(3G) β€” aka the 3G girlies' guide to making textures ✨

okay so bestie, gather round 🫢 this one is genuinely iconic β€” it's glCreateTextures, and it's the function that literally makes texture objects out of thin air. no cap. it lives in the 3G section of the manual, which is giving "OpenGL and friends only" energy, so don't go looking for it in 1 or 8. πŸ’–


✨ C SPECIFICATION ✨

here's the exact signature, don't @ me, type it exactly like this:

void glCreateTextures(GLenum target, GLsizei n, GLuint *textures);

πŸŽ€ PARAMETERS πŸŽ€

  • target β€” tells the function what kind of texture each new one should be, i.e. its effective texture target. this is the vibe check for the whole batch 🌈
  • n β€” how many texture objects you want. the number. how many. πŸ“
  • textures β€” an array you pass in, and the names of all your shiny new texture objects get stored in it. you bring the bucket, it brings the goods 🧚

πŸ”₯ DESCRIPTION πŸ”₯

okay so glCreateTextures hands you back n previously unused texture names in textures. "previously unused" is doing a lot of work there β€” these are fresh names, never touched before, no cap. each one represents a brand-new texture object, and its dimensionality and type come from whatever you passed as target, and it's initialized to the default values for that texture type. so it's ready to go, just at factory settings πŸ’…

and target must be one of these, periodt:

  • GL_TEXTURE_1D
  • GL_TEXTURE_2D
  • GL_TEXTURE_3D
  • GL_TEXTURE_1D_ARRAY
  • GL_TEXTURE_2D_ARRAY
  • GL_TEXTURE_RECTANGLE
  • GL_TEXTURE_CUBE_MAP
  • GL_TEXTURE_CUBE_MAP_ARRAY
  • GL_TEXTURE_BUFFER
  • GL_TEXTURE_2D_MULTISAMPLE
  • GL_TEXTURE_2D_MULTISAMPLE_ARRAY

like, that's the whole list. eleven options. memorize it or keep this page open, iykyk πŸ“–


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_ENUM is generated if target is not one of the allowable values. so if you freelanced a target, that's on you bestie 😭
  • GL_INVALID_VALUE is generated if n is negative. negative textures are not a thing. the void does not have a texture count. πŸ™ˆ

πŸ‘‘ VERSION SUPPORT πŸ‘‘

so the original has a whole grid here, and the vibe of the grid is honestly just: this is a 4.5-only situation. here's the tea ⭐

  • glCreateTextures β€” not supported in OpenGL 2.0 ❌
  • glCreateTextures β€” not supported in OpenGL 2.1 ❌
  • glCreateTextures β€” not supported in OpenGL 3.0 ❌
  • glCreateTextures β€” not supported in OpenGL 3.1 ❌
  • glCreateTextures β€” not supported in OpenGL 3.2 ❌
  • glCreateTextures β€” not supported in OpenGL 3.3 ❌
  • glCreateTextures β€” not supported in OpenGL 4.0 ❌
  • glCreateTextures β€” not supported in OpenGL 4.1 ❌
  • glCreateTextures β€” not supported in OpenGL 4.2 ❌
  • glCreateTextures β€” not supported in OpenGL 4.3 ❌
  • glCreateTextures β€” not supported in OpenGL 4.4 ❌
  • glCreateTextures β€” supported in OpenGL 4.5 βœ”

one single checkmark. one. she waited for 4.5 and she ate πŸ”₯


🌸 SEE ALSO 🌸

go read these next, they're the friend group 🫢

  • glBindTexture()
  • glDeleteTextures()
  • glGenTextures()
  • glGet()
  • glGetTexParameter()
  • glIsTexture()
  • glTexBuffer()
  • glTexImage1D()
  • glTexImage2D()
  • glTexImage2DMultisample()
  • glTexImage3D()
  • glTexImage3DMultisample()
  • glTexParameter()

Copyright Β© 2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/

and then, yes, the copyright line is literally listed a second time in the original, so here it is again, because we keep every detail in this house β€” no skipping, no summarising, that's the rule πŸ‘‘

Copyright Β© 2014 Khronos Group


and that's the page!! πŸ¦‹ cute little sign-off for you: the source line on this one literally just says [FIXME: source] (iconic of them honestly), the date is 08/09/2021, and the whole thing is filed under GLCREATETEXTURES(3G). now go make some textures, main character πŸ’œβœ¨

πŸ“¦ where this page comes from