Jump to content

  • Log In with Google      Sign In   
  • Create Account


glEnableClientState and glDisableClientState, client and server


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 iamcreasy   Members   -  Reputation: 127

Like
0Likes
Like

Posted 13 June 2011 - 03:16 PM

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?

Sponsor:

#2 Danny02   Members   -  Reputation: 275

Like
2Likes
Like

Posted 13 June 2011 - 04:04 PM

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.

#3 mhagain   Crossbones+   -  Reputation: 7431

Like
1Likes
Like

Posted 13 June 2011 - 04:31 PM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 iamcreasy   Members   -  Reputation: 127

Like
0Likes
Like

Posted 13 June 2011 - 06:18 PM

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.)

#5 mhagain   Crossbones+   -  Reputation: 7431

Like
0Likes
Like

Posted 14 June 2011 - 03:05 AM

Maybe it is and maybe it isn't, but that's just the way OpenGL works and you're stuck with it.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#6 Brother Bob   Moderators   -  Reputation: 7780

Like
1Likes
Like

Posted 14 June 2011 - 09:45 AM

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.

#7 iamcreasy   Members   -  Reputation: 127

Like
0Likes
Like

Posted 18 June 2011 - 09:59 AM

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.

#8 V-man   Members   -  Reputation: 797

Like
0Likes
Like

Posted 21 June 2011 - 12:07 AM

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);




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS