Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glInterleavedArray

  1. #1


    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
    Fargo, ND

    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.
    Software Engineer and OpenGL enthusiast

Posting Permissions

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