Multitexturing with vertex buffer object
Hi,
I'm trying to do multi texture with vbo, but I ran into this and I'm not sure how to go about it.
let say my vertex is:
struct Vertex
{
float x, y, z;
DWORD specularColor;
float nx, ny, nz;
float tu, tv;
float tu2, tv2;
};
the problem comes when I need to specify the array pointers as well as enable/disable clientstate.
glVertexPointer(3, GL_FLOAT, stride, BUFFER_OFFSET(0));
glSecondaryColorPointer(4, GL_UNSIGNED_BYTE, stride, BUFFER_OFFSET(12));
glNormalPointer(GL_FLOAT, stride, BUFFER_OFFSET(16));
glTexCoordPointer(2, GL_FLOAT, stride, BUFFER_OFFSET(28));
then I'm not sure how to specify for the last set of texture coordinate.
The same goes for enable client state:
glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
I'm just not sure what I need to set for the last set of texture coordinate.
Appreciate any help and info on this.
Thanks.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement