GLGENSAMPLERS(3G)

✨ NAME ✨

glGenSamplers β€” generate sampler object names. And yes bestie, you clocked it: this is the GLGENSAMPLERS(3G) manual page, and we're gonna get through it together πŸ’…βœ¨

πŸ’» C SPECIFICATION πŸ’»

void glGenSamplers(GLsizei n, GLuint *samplers);

πŸŽ€ PARAMETERS πŸŽ€

  • n β€” the number of sampler object names you want to generate. Simple as that, no cap 🫢
  • samplers β€” the array where the generated sampler object names get stored. Basically the lil basket you're putting the names into 🧺✨

🌸 DESCRIPTION 🌸

Okay so glGenSamplers returns n sampler object names in samplers. And listen β€” there is no guarantee that those names form a contiguous set of integers. Like, they don't have to be all cute and sequential. However, it is guaranteed that none of the returned names was in use immediately before the call to glGenSamplers β€” so no accidental recycling of a name that was already taken, periodt πŸ”₯

Sampler object names returned by a call to glGenSamplers are not returned by subsequent calls, unless they are first deleted with glDeleteSamplers(). So if you want a name back in the pool, you gotta delete it first, bestie πŸ—‘οΈβœ¨

The names returned in samplers are marked as used, for the purposes of glGenSamplers only, but they acquire state and type only when they are first bound. So they're like reserved seats at the function, not fully main-character yet πŸ‘‘πŸͺ‘πŸ’«

πŸ“ NOTES πŸ“

glGenSamplers is available only if the GL version is 3.3 or higher. Older GL? Not invited to this party, sorry bestie πŸ˜­πŸ™ˆ

πŸ’€ ERRORS πŸ’€

GL_INVALID_VALUE is generated if n is negative. So yeah, don't pass a negative number unless you're actively trying to summon an error πŸ’€βœ¨

🌈 VERSION SUPPORT 🌈

The support table is giving very "who's invited to the OpenGL version party" energy. Here's the invite list, preserved in full πŸŽ€

  • OpenGL Version columns: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5
  • Function / Feature Name: glGenSamplers
    • 2.0: -
    • 2.1: -
    • 3.0: -
    • 3.1: -
    • 3.2: βœ”
    • 3.3: βœ”
    • 4.0: βœ”
    • 4.1: βœ”
    • 4.2: βœ”
    • 4.3: βœ”
    • 4.4: βœ”
    • 4.5: βœ”

πŸ¦‹ SEE ALSO πŸ¦‹

Go bother glBindSampler(), glIsSampler(), and glDeleteSamplers() β€” they're all in the group chat together πŸ«ΆπŸ’¬

Copyright Β© 2010-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/.

Copyright Β© 2010-2014 Khronos Group.


Sign-off time, bestie: the source/version tag is [FIXME: source], the date is 08/09/2021, and the manual is GLGENSAMPLERS(3G) β€” bye and drink some water πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from