Function familiesfamily

glCreate*

Create objects that exist immediately, ready for DSA calls; shaders and programs are created this way too.

Signature

void glCreate{Buffers|VertexArrays|Textures|Framebuffers|Renderbuffers}(GLsizei n, GLuint *ids);
GLuint glCreateShader(GLenum type);
GLuint glCreateProgram(void);

How it works

The GL 4.5 versions of glGen* (same parameters) create the real object at once, so it can go straight into glNamedBufferStorage, glTextureStorage2D and the other DSA calls without ever being bound. glCreateTextures also takes the texture type, which glGenTextures could not know.

glCreateShader and glCreateProgram are older and different: they make one object and return its name. They are listed here because the name looks the same.

Reading the name

Buffers, VertexArrays…
Plural: n objects into an array, like glGen*.
Shader, Program
Singular: one object, returned as the result.

Functions in this family

Example

example.cpp
1GLuint tex;
2glCreateTextures(GL_TEXTURE_2D, 1, &tex);
3glTextureStorage2D(tex, levels, GL_SRGB8_ALPHA8, w, h);