Results 1 to 5 of 5

Thread: glIndexPointers and glDrawRangeElements type param

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2004
    Posts
    19

    glIndexPointers and glDrawRangeElements type param

    Just out of curiosity, is there a reason why glIndexPointer only accepts GL_UNSIGNED_BYTE, GL_SHORT, GL_INT, GL_FLOAT and GL_DOUBLE while glDrawRangeElements only wants GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT and GL_UNSIGNED_INT?
    Of course everything is cleary stated in the spec but nevertheless I found it a bit surprising and it's probably easy to overlook when you are sitting in front of a black screen trying to find out why nothing is drawn. (not that this would ever happen to me )

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: glIndexPointers and glDrawRangeElements type param

    The types for glIndexPointer and glDrawRangeElements are completely unrelated, and there is no reason why they should accept the same set of types. In glDrawRangeElements, you specify the type of the values used as array index in the vertex arrays. glIndexPointer sets the color index pointer; in other words, it is the glColorPointer equivalent for paletted color modes (8-bit index colors vs 16/24/32-bit RGB(A) colors).

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2004
    Posts
    19

    Re: glIndexPointers and glDrawRangeElements type param

    Aaaaahh, okay, so you specifiy a color palette with glIndexPointer, now the types make sense.
    I just used glIndexPointer as an 'equivalent' of the other gl*Pointer but instead of setting up a vertex buffer I thought you can use it for the index buffer.
    Btw someone knows where to find a good slim documentation for OpenGL similiar to the D3D helpfile? I only found an ancient GL helpfile where the gl*Pointer functions are still marked as extensions with an additional parameter.
    Oh and thanks for the clarification probably I would have never found this out by myself because everything worked and no error codes where thrown. So expect more 'noobish' questions from me in the future.

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: glIndexPointers and glDrawRangeElements type param

    For online OpenGL reference doc I frequently use the pyOpenGL one, they describe the C bindings too, and does not seem outdated :
    http://pyopengl.sourceforge.net/documentation/manual/

    And of course the GL spec itself :
    http://www.opengl.org/documentation/spec.html

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2004
    Posts
    19

    Re: glIndexPointers and glDrawRangeElements type param

    Thanks for the python docu link. I'll give it a try.

Similar Threads

  1. glTexStorage* 'levels' param, and bad texture rendering.
    By holland01 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 01-28-2014, 05:52 PM
  2. undefined name-attribute in param-element
    By Friba77 in forum COLLADA
    Replies: 2
    Last Post: 08-29-2012, 11:21 AM
  3. <accessor> - <param> - bug
    By Friba77 in forum COLLADA
    Replies: 3
    Last Post: 07-06-2012, 08:27 AM
  4. accessor/param syntax question
    By mmikkelsen in forum COLLADA
    Replies: 1
    Last Post: 01-21-2011, 01:04 PM
  5. Easy question...What is bias param in textureXD?
    By Stuart McDonald in forum OpenGL: GLSL
    Replies: 4
    Last Post: 10-09-2006, 03:48 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