Results 1 to 6 of 6

Thread: glDrawElements

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2013
    Posts
    22

    glDrawElements

    Given the function:

    Code :
    void glDrawElements(GLenum mode,  GLsizei count,  GLenum type,  const GLvoid * indices);

    I find myself confused about what the pointer indicies is used for. According to khronos: "Specifies a pointer to the location where the indices are stored."

    Indices are stored in GPU memory using a GL_ELEMENT_ARRAY_BUFFER. Is this indices pointer just a holdover from legacy GL where vertex attributes and indices were stored in client-side memory? Does it have any use still in core profile GL?

  2. #2
    Member Newbie
    Join Date
    Jan 2014
    Posts
    40
    If indices are in the video ram buffer the pointer parameter is interpreted as a byte offset from the index array start

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2013
    Posts
    149
    glDrawElements and other commands can work on Vertex Buffers (Always system memory) and Vertex Buffer Objects (Can be in vram).
    Vertex Buffers are the default mode of operation, where the pointer points to system memory.
    If you bind an VBO, then the pointer will point to the VBO memory space.

  4. #4
    Junior Member Newbie
    Join Date
    Dec 2013
    Posts
    22
    Quote Originally Posted by Osbios View Post
    Vertex Buffers are the default mode of operation, where the pointer points to system memory.
    Not in core profile it isn't.

  5. #5
    Senior Member Regular Contributor
    Join Date
    May 2013
    Posts
    149
    Quote Originally Posted by Chris_F View Post
    Not in core profile it isn't.
    With that definition glBegin also has a different default behaviour in core profile.

  6. #6
    Junior Member Newbie
    Join Date
    Dec 2013
    Posts
    22
    Quote Originally Posted by Osbios View Post
    With that definition glBegin also has a different default behaviour in core profile.
    I like to pretend that those functions simply don't exist. To quote Ian Romanick from Intel, "it [compatibility profile] should die in a fire anyway."

Similar Threads

  1. about glDrawElements
    By freesui1984 in forum OpenGL ES
    Replies: 3
    Last Post: 10-10-2008, 04:17 AM
  2. Getting glDrawElements
    By Cribs in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-24-2007, 09:46 PM
  3. glDrawElements
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-28-2005, 04:39 AM
  4. Once & Again: glDrawElements
    By t33mu in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 06-02-2001, 09:16 AM
  5. glDrawElements()
    By eckiller in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 05-04-2000, 11:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean