If I draw without enable GL_VERTEX_ARRAY in 2.1

What will happen?

I have read man page of OpenGL 2 and it have mention about EnableClientState(GL_VERTEX_ARRAY) for draw things

I don’t fully understand that short explanation, I want to know what it will really be

And also

If I understand it right, It means we cannot do anything if we don’t EnableClientState(GL_VERTEX_ARRAY) and use glVertex* ,which is deprecated in 3.0 right?

How can I just use only glVertexAttrib* ,which is promoted tobe main method of future version and ES

Thanks for all reply

We have a wiki for this sort of thing.

Is that related?

At least I ask about 2.1 not 3.0 but yours is 3.0

At least I ask about 2.1 not 3.0 but yours is 3.0

Your post:

The only reason you would care about what is deprecated in 3.0 and removed in 3.1 is if you are actually using core 3.1 and above. Otherwise, just use what you’ve got and don’t worry about it; compatibility will always be there.

Furthermore, there’s nothing on that page which is limited to 3.0 or above. VAOs are from the ARB_vertex_array_object extension which is supported on plenty of 2.1 hardware (and you don’t even need VAOs specifically, since without VAO’s, everything’s just context state). The same goes for many of the features related to drawing.

You misunderstand

What I care about is to try to use 2.1 in the nearest way as 3 and ES 2.0

In the 2.1 doc it seem like openGL force every draw to enable GL_VERTEX_ARRAY and use glVertex* functions, which is removed from ES 2.0 and above 3

So I try to find any way to avoid it

I don’t care anything between 3.0 and 3.1
You are so wrong from the first place, please be careful

Also, I will not use extension, even ARB is not my taste, I will use only core function from 2.1
I just try to make my style compatible with 2.0 ES as much as possible

Use the generic vertex attribute pointers with shaders. That’s the closest thing to OpenGL 3.x and ES.
See here for more infomation

In the 2.1 doc it seem like openGL force every draw to enable GL_VERTEX_ARRAY and use glVertex* functions, which is removed from ES 2.0 and above 3

Then the man pages are wrong (it won’t be the first time, and I’m submitting a bug on it). I checked the OpenGL 2.1 specification, and it says that vertices are specified by glVertex or glVertexAttrib with an index of 0.

You are so wrong from the first place, please be careful

The only thing not mentioned on that page that is important to your needs is the need for attribute 0 (which is something that core 3.0 cast off. Not to mention OpenGL ES 2.0). And it’s mentioned there now.

How can I just use only glVertexAttrib* ,which is promoted tobe main method of future version and ES

You can use VertexAttrib if your OpenGL version is below 3.x, as long as you have vertex/fragment shader extensions (I don’t know for vertex/fragment program extensions).
As far as I can remember, ARB_vertex_shader extension specs says that.

See http://www.opengl.org/registry/specs/ARB/vertex_shader.txt and http://www.opengl.org/wiki/GlVertexAttribPointer for more details.

That’s not what glspec20.pdf says.

Thanks for every reply

I’m so appreciate, I’ll go to try experiment right now

Thank you, everyone

Really ? mmmm my mistake then. So what’s the correct behavior ? Where to know about it ?

So what’s the correct behavior ?

ahem:

You must use either GL_VERTEX_ARRAY or attribute 0.