Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Is drawing using glArrayElement between glBegin()/glEnd() as eff. as glDrawElements?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2018
    Posts
    10

    Is drawing using glArrayElement between glBegin()/glEnd() as eff. as glDrawElements?

    Is drawing using glArrayElement between glBegin()/glEnd() as eff. as glDrawElements?

    I.e. e.g.

    Code :
    glEnableClientState( GL_VERTEX_ARRAY );
    glEnableClientState( GL_COLOR_ARRAY );
    glVertexPointer( 2, GL_INT, 0, vertices );
    glColorPointer( 3, GL_FLOAT, 0, colors );
    glBegin( GL_TRIANGLES );
    glArrayElement( 1 );
    glArrayElement( ... );
    glArrayElement( n );
    glEnd();

    VS

    Code :
    glEnableClientState( GL_VERTEX_ARRAY );
    glEnableClientState( GL_COLOR_ARRAY );
    glVertexPointer( 2, GL_INT, 0, vertices );
    glColorPointer( 3, GL_FLOAT, 0, colors );
    glDrawArrays(...)
    ...

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,984
    Quote Originally Posted by mavavilj View Post
    Is drawing using glArrayElement between glBegin()/glEnd() as eff. as glDrawElements?
    Probably not. It's an improvement over calling glNormal/glVertex/etc, but the overhead of one call per vertex is still going to be significant.

Posting Permissions

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