Legacy (immediate mode)GL 1.1

glEnableClientState

Turned on one of the fixed vertex arrays (positions, colours, normals…) of old OpenGL.

Removed from the core profile. Part of the legacy immediate mode, removed from the core profile in OpenGL 3.2. Shown here only so you can recognize it in old tutorials — use VBOs and VAOs instead.

Signature

void glEnableClientState(GLenum cap);

How it works

Between immediate mode and modern attributes, OpenGL 1.1 had vertex arrays with fixed roles: GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_NORMAL_ARRAY, GL_TEXTURE_COORD_ARRAY. Each was turned on with this call and described with glVertexPointer, glColorPointer and so on. Today every attribute is generic: glEnableVertexAttribArray(location) plus glVertexAttribPointer, and the shader decides what each one means.

Parameters

capGLenum

GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_NORMAL_ARRAY or GL_TEXTURE_COORD_ARRAY.

Example

example.cpp
1glEnableClientState(GL_VERTEX_ARRAY);
2glVertexPointer(3, GL_FLOAT, 0, positions);
3glDrawArrays(GL_TRIANGLES, 0, 3);