Daniel
Daniel

Reputation: 31579

What is the difference between glEnable and glEnableClientState?

What is the difference between glEnable and glEnableClientState? Every time I need a mode set/unset I have to look at the reference to know which of those will accept it. Os there any general rule which says what modes goes into which one?

Upvotes: 5

Views: 2667

Answers (3)

Christian Rau
Christian Rau

Reputation: 45948

In addition to tibur's answer, in practice the only use of glEnableClientState and glDisableClientState is for enabling/disabling the builtin fixed-function attribute arrays (like GL_VERTEX_ARRAY, GL_NORMAL_ARRAY, ...). For all other states you use glEnable and glDisable (or glEnableVertexAttribArray and glDisableVertexAttribArray for the generic vertex shader attributes).

Upvotes: 7

Nicol Bolas
Nicol Bolas

Reputation: 473352

glEnable is used for the set of state that the OpenGL ARB determined represented internal driver state. glEnableClientState is for state that represents information that you more directly control. The only client state that existed to be enabled/disabled were the old vertex array states. And those were superceeded by glEnable/DisableVertexAttribArray.

The distinction is really quite meaningless since the driver still manages all of this state.

Upvotes: 3

tibur
tibur

Reputation: 11636

glEnable are server side while glEnableClientState are client side. Think at server side as you CPU and client side as your GPU. Globally, vertex arrays only are client side.

Upvotes: 2

Related Questions