Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glEnableClientState and glEnableVertexAttribArray

Tags:

opengl

Does the latter deprecate the former?

I'm writing code which I would like to work on shader 2.0 hardware, but I want to use the more recent programming conventions such as VAO's.

So I have been using the glVertexAttribPointer functions instead of glVertexPointer, glNormalPointer, glColorPointer and so on.

It seems as though we have come to a point where the server-client concept isn't... particularly relevant (edit: I meant as it applies to switching state for these buffer pointers). But I'd like to know just what the old En/DisableClientState actually does and how it relates to what glEnableVertexAttribArray actually does.

And I also don't have any graphics hardware from 5 generations ago, but surely some user of my software might. How might I go about preventing my code from failing to compile on a Radeon 9700 for instance? (Though I hope if a user has the latest driver it might support the new stuff)

like image 713
Steven Lu Avatar asked Jan 11 '12 22:01

Steven Lu


1 Answers

It seems as though we have come to a point where the server-client concept isn't... particularly relevant

Actually it's very relevant. The whole Buffer Objects terminology is in terms of server and client. The buffers are server side, and the client just issues drawing commands referring to the server side buffers.

The main reason for replacing glEnableClientState with glEnableVertexAttribArray is, that since OpenGL-3 always uses vertex arrays (there's no longer an immediate mode), and the distinction if the data is client or server side, is made by the binding states of the various buffer object slots. If buffer object 0 is bound, the data is client side, if the bound buffer object is nonzero it's server side.

like image 175
datenwolf Avatar answered Oct 03 '22 17:10

datenwolf