glEnableClientState and glDisableClientState, client and server

Started by
6 comments, last by V-man 12 years, 10 months ago
What is the meaning of glEnableClientState and glDisableClientState in OpenGL. So, far what I ve found is, these functions are to enable or disable some client side capabilities.

Well, what exactly is the client or server here? I am running my OpenGL program in my pc. who is this refering to?

Why we even need to disable certain capabilities. And more intriguing its about some sort of an array related thing!

The whole picture is very gray to me.

Can anyone enlighten me about this terminologies?
Advertisement
When u talk about Client and Server in OpenGL, the Server is the GPU and the Client the CPU/driver.

These two commands are used for specifying vertex attributs. Take a look at the Vertex Arrays to see what this have to do with arrays.

The thing why u have to enable and disable stuff in OpenGL is, because the design of OpenGL based on states.
The two commands activate or deactivate the state of a specific vertex attribute, for example u want to render a model with and without a color attribute.
You're probably familiar with glBegin/glEnd. The array thing is a means of allowing you to (roughly speaking) group a glBegin/glEnd pair, and everything in between, in a single OpenGL call. Because each function call you make has a fixed overhead, regardless of how much work is done in the call, it follows that reducing the number of function calls can lead to increased performance. There's also the fact that modern hardware and drivers tend to be optimized better for this kind of usage than for glBegin/glEnd.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


When u talk about Client and Server in OpenGL, the Server is the GPU and the Client the CPU/driver.

These two commands are used for specifying vertex attributs. Take a look at the Vertex Arrays to see what this have to do with arrays.

The thing why u have to enable and disable stuff in OpenGL is, because the design of OpenGL based on states.
The two commands activate or deactivate the state of a specific vertex attribute, for example u want to render a model with and without a color attribute.


Wasn't it more efficient to pass that specific vertex attribute as a function argument, rather then an enable-disable scope?

Why we need to enable cpu/drive to do that? isn't is possible or its is an error to do so on gpu/server side?

(Im asking this, cause, i haven't yet succeeded in writing a running program.)
Maybe it is and maybe it isn't, but that's just the way OpenGL works and you're stuck with it.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

It has to do with states associated with data on the client or the server side. Any state you enable such as lighting, texturing and blending are all on the server side (and besides, the driver is on the sever side, not the client side). The old manually managed vertex arrays application memory, for example, is an example of client side data, and the vertex arrays are enabled on the client side. With the introduction of server side managed vertex arrays, this distinction is somewhat messed up (client side commands to enable server side states).

Now it makes less sense to talk about client and server side on normal computers as most people know them. But when the client and server are on separate computers, then this distinction has a meaning. For example, the server (driver/gpu) could be the thin client you're working on which has the keyboard, mouse and screen attached to it, while the client (the computer where the program is running) could be the large corporate mainframe. The distinction between server and client in this context is kind of opposite to what functionality the computers have outside OpenGL.

It has to do with states associated with data on the client or the server side. Any state you enable such as lighting, texturing and blending are all on the server side (and besides, the driver is on the sever side, not the client side). The old manually managed vertex arrays application memory, for example, is an example of client side data, and the vertex arrays are enabled on the client side. With the introduction of server side managed vertex arrays, this distinction is somewhat messed up (client side commands to enable server side states).

Now it makes less sense to talk about client and server side on normal computers as most people know them. But when the client and server are on separate computers, then this distinction has a meaning. For example, the server (driver/gpu) could be the thin client you're working on which has the keyboard, mouse and screen attached to it, while the client (the computer where the program is running) could be the large corporate mainframe. The distinction between server and client in this context is kind of opposite to what functionality the computers have outside OpenGL.


thanks.
Client and server?
Nah, there is no client and server. There is just your application and the GL driver which talks to another driver which talks to the GPU.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement