say what?!? help on glInterleavedArrays()

Member
Posts: 185
Joined: 2005.02
Post: #1
the redbook version 1.1 is really hazy about this function's, well function, and how to use it. well, its actually really unclear about the whole function. could anyone explain it to me?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
It's equivalent to calling gl*Pointer with certain offsets and strides based on the interleaved format you give it. It also calls glEnableClientState appropriately for you.

For example, if you have GLfloat vertices[8 * VERTEX_COUNT], glInterleavedArrays(GL_T2F_N3F_V3F, 0, vertices) is equivalent to:

Code:
glTexCoordPointer(2, GL_FLOAT, 8 * sizeof(float), vertices);
glNormalPointer(GL_FLOAT, 8 * sizeof(float), vertices + 2);
glVertexPointer(3, GL_FLOAT, 8 * sizeof(float), vertices + 5);

glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
Quote this message in a reply
Member
Posts: 185
Joined: 2005.02
Post: #3
ok there is a table of all the different formats. on the top there are et ec en st sc sv tc pc pn pv s and then their values (or for et ec and en it is true or false) for the different formats. i figured out that et stands for GL_TEXTURE_COORD_ARRAY,
ec stand for GL_COLOR_ARRAY, and en stand for GL_NORMAL_ARRAY.
what do st, sc, sv, tc, pc, pn, pv, and s stand for?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
*shrug*

The names of the formats are descriptive enough that I don't know why you'd want a table like that...
Quote this message in a reply
Member
Posts: 185
Joined: 2005.02
Post: #5
oh, i think i get it.
so in glInterleavedArrays(GL_T2F_N3F_V3F, 0, vertices) V3F stand for 3 vertices represented as floats, right?
what does N and T stand for?
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #6
ferum Wrote:oh, i think i get it.
so in glInterleavedArrays(GL_T2F_N3F_V3F, 0, vertices) V3F stand for 3 vertices represented as floats, right?
what does N and T stand for?

If you read the example OSC posted (post #2), you'll figure it out... Rolleyes
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #7
ferum Wrote:what does N and T stand for?

From the man page (which is on your computer already, just type "man glInterleavedArrays"):

DESCRIPTION
glInterleavedArrays lets you specify and enable individual color, nor-
mal, texture and vertex
arrays whose elements are part of a larger
aggregate array element.
Quote this message in a reply
Post Reply