Results 1 to 7 of 7

Thread: Indexed Vertex Buffers?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    6

    Indexed Vertex Buffers?

    Hi,

    I am just starting to look at OpenGL to make my DirectX engine cross-platform, and I was wondering if OpenGL has the ability to do indexed vertex buffers like DirectX? The beginners book I have does not mention it, but then I think it is geared towards v1.1.

    Thanks!

  2. #2
    Guest

    Re: Indexed Vertex Buffers?

    Yes it does. Look at the VBO spec in the extension registry and the spec.

    http://www.opengl.org/documentation/spec.html
    http://oss.sgi.com/projects/ogl-sample/registry/

    Hlz

  3. #3
    Guest

    Re: Indexed Vertex Buffers?

    ... buffer objects start on page 33 of the 2.0 spec.

    Hlz

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    6

    Re: Indexed Vertex Buffers?

    Originally posted by <Hlz>:
    ... buffer objects start on page 33 of the 2.0 spec.

    Hlz
    Thanks for your reply. Is 2.0 supported for windows? My book says the 'wiggle' stuff is only v1.1.

  5. #5
    Guest

    Re: Indexed Vertex Buffers?

    Is 2.0 supported for windows?
    This really depends on the card you have. Some things like FBOs and GLSL are still fairly new and a bit shakey in some areas, but work for the most part.

    But all you need to do is check the extension string for support of the things you are interested in for a particular card. The extension registry link above has some details on this, like the glext.h and wglext.h headers you'll need.

    Vertex buffer objects have been in the core since 1.5 I think.

    Hlz

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    6

    Re: Indexed Vertex Buffers?

    Originally posted by <Hlz>:
    Is 2.0 supported for windows?
    This really depends on the card you have. Some things like FBOs and GLSL are still fairly new and a bit shakey in some areas, but work for the most part.

    But all you need to do is check the extension string for support of the things you are interested in for a particular card. The extension registry link above has some details on this, like the glext.h and wglext.h headers you'll need.

    Vertex buffer objects have been in the core since 1.5 I think.

    Hlz
    Thank you. Looks like it's time to get my hands dirty

  7. #7

    Re: Indexed Vertex Buffers?

    you can use stuff like this:

    glInterleavedArrays(GL_T2F_V3F, 0, @pointer to vertices, tex coords, normal and color data);
    glDrawElements(GL_quads, 4, GL_UNSIGNED_INT (data format of indexes), @pointer to vertex indexes);

    the function is part of opengl 1.1 so it works on practically all implementations.

    whole documentation is like this:
    from http://pyopengl.sourceforge.net/docu...ements.3G.html

    glDrawElements specifies multiple geometric primitives with very few subroutine calls. Instead of
    calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can
    prespecify separate arrays of vertexes, normals, and so on and use them to construct a sequence of primitives with a
    single call to glDrawElements.


    When glDrawElements is called, it uses count sequential elements from an
    enabled array, starting at indices to construct a sequence of geometric primitives.
    mode specifies what kind of primitives are constructed, and how the array elements construct
    these primitives. If more than one array is enabled, each is used. If GL_VERTEX_ARRAY is not
    enabled, no geometric primitives are constructed.


    Vertex attributes that are modified by glDrawElements have an unspecified value after
    glDrawElements returns. For example, if GL_COLOR_ARRAY is enabled, the value
    of the current color is undefined after glDrawElements executes. Attributes that aren't modified
    maintain their previous values.

Similar Threads

  1. Using indexed vertex arrays?
    By Duncan Champney in forum OpenGL: Basic Coding
    Replies: 16
    Last Post: 04-02-2008, 04:40 PM
  2. Can you do multiple indexed buffers?
    By Plüss Roland in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 09-12-2005, 10:32 AM
  3. Indexed vertex arrays
    By dbugger in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 03-04-2002, 09:57 AM
  4. Vertex Buffers and render/texture Buffers
    By schelter in forum OpenGL: General
    Replies: 4
    Last Post: 02-03-2002, 08:00 PM
  5. Indexed Vertex Arrays
    By julius in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-13-2001, 04:06 AM

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