Archived

This topic is now archived and is closed to further replies.

Allebarde

glInterleavedArrays

Recommended Posts

Hi! I have a problem with the function glInterleavedArrays: static GLfloat intertwined[] = {0.8f, 1.0f, 0.2f, 1.75f, 2.50f, 0.75f, 0.75f, 0.75f, 1.75f, 3.25f, 0.35f, 0.35f, 0.35f, 2.50f, 2.50f }; glInterleavedArrays (GL_C3F_V3F, 0, intertwined); But I don''t see anything on the screen.. But is the function going to draw on the screen? Me maybe need to call after glDrawElements or glDrawArrays. But how do we use those functions after have called glInterLeavedArrays? Thanks for your answer (excuse my english i''m french Bye!

Share this post


Link to post
Share on other sites
Hi,

you call glEnableClientState(parameter) to enable the color and vertex array.

glInterleavedArrays (GL_C3F_V3F, 0, intertwined);

glDrawArrays(GL_QUADS,0,number of vertices);


There are a mistake in definition of "intertwined"
the variable "intertwined" should like this, if you use the parameter GL_C3F_V3F in glInterleadArrays.

static GLfloat intertwined[] ={
//1.vertices
Red-Value,Green-Value,Blue-Value,x-coord,y-coord,z-coord,
//2.vertices
Red-Value,Green-Value,Blue-Value,x-coord,y-coord,z-coord,
//3.vertices
Red-Value,Green-Value,Blue-Value,x-coord,y-coord,z-coord,
//4.vertices
Red-Value,Green-Value,Blue-Value,x-coord,y-coord,z-coord};

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
glInterleavedArrays() makes the proper glEnableClientState() calls for you, but it doesn''t draw anything. All it does is specify the array. The above post shows how to use glDrawArrays().

Share this post


Link to post
Share on other sites