Results 1 to 2 of 2

Thread: glInterleavedArray

  1. #1
    Guest

    glInterleavedArray

    Does the following code shows the correct usage of the glInterleavedArray function?

    How does the function know how many elements are there in the array?

    ------------------------------------------
    typedef struct {

    float tx, ty;
    float nx, ny, nz;
    float x, y, z;

    } VERTEX;

    VERTEX vert[4];

    glInterleavedArrays ( GL_T2F_N3F_V3F, 0, vert );

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: glInterleavedArray

    Yes, that's correct. That part doesn't draw the array, though. It just sets the pointer and format. To draw the array, you use glDrawArrays, glDrawElements, glArrayElement, etc.

    For those drawing functions you specify indices into the array and length, so the glInterleavedArray function doesn't need to know the length of the array at that point.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Use VBO with glInterleavedArray
    By CelticDaddio in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 03-20-2007, 12:09 AM
  2. gl*Pointer's with glinterleavedarray?
    By Vexator in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 11-04-2005, 12:12 PM
  3. glInterleavedArray with Struct Arrays?
    By Statix in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 02-26-2003, 12:52 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