Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: If I draw without enable GL_VERTEX_ARRAY in 2.1

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    4

    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

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,792

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    We have a wiki for this sort of thing.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    4

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    Is that related?

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

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,792

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    At least I ask about 2.1 not 3.0 but yours is 3.0
    Your post:

    Quote Originally Posted by you
    which is deprecated in 3.0 right?
    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.

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    4

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    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

  6. #6
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,171

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

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

  7. #7
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,792

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    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.

  8. #8
    Member Regular Contributor
    Join Date
    Oct 2010
    Location
    France
    Posts
    466

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    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...tex_shader.txt and http://www.opengl.org/wiki/GlVertexAttribPointer for more details.

  9. #9
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    Quote Originally Posted by _arts_
    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...tex_shader.txt and http://www.opengl.org/wiki/GlVertexAttribPointer for more details.
    That's not what glspec20.pdf says.
    ------------------------------
    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);

  10. #10
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    4

    Re: If I draw without enable GL_VERTEX_ARRAY in 2.1

    Thanks for every reply

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

    Thank you, everyone

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •