I’m trying to use glVertexAttribPointer instead of the normal glVertexPointer, glColorPointer, etc. But I can’t get it to work in my program. Shouldn’t these be equivalent?
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_FLOAT, sizeof(SVertexBasis), &vl->dux);
and
glEnableClientState(GL_VERTEX_ATTRIB_ARRAY3_NV);
glVertexAttribPointerNV(3, 4, GL_FLOAT, sizeof(SVertexBasis), &vl->dux);
But, while the first works perfectly with my vertex program, the second does absolutely nothing at all. Using the glVertexAttribPointer function, my scene is rendered with whatever color was last set with glColor. I have the same problem if I try and use glVertexAttribPointer(0, …) instead of glVertexPointer. Can anyone tell me what I’m doing wrong? I’ve tried calling the glGetVertexAttribPointer to see if it was even getting set, but it returns the correct address to my data. Is there another state that I may be forgetting to set?
Thanks,
Marc
BTW, here’s the vertex program I’m using. It was originally more complicated, but I stripped it down to just this while trying to debug this problem.
!!VP1.0
DP4 o[HPOS].x, c[0], v[0];
DP4 o[HPOS].y, c[1], v[0];
DP4 o[HPOS].z, c[2], v[0];
DP4 o[HPOS].w, c[3], v[0];
MOV o[TEX0], v[8];
MOV o[TEX1], v[9];
MOV o[COL0], v[3];
END