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?
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).
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With