Use glClientActiveTexture to set the active (client) texture unit and then set the pointer for that unit.
As for interleaved arrays, that's really just a waste of time. Just use the appropriate gl*Pointer functions. At least that way you decide how to structure your data instead of following the specific formats glInterleavedArrays provides.
E.g.
Local tc:Byte Ptr ' the data -- in the case of a vbo, this would remain Null
' for the sake of example, the data is arranged as such: uv0, uv1, uv0, uv1
' where uv are the respective components and the number is the channel
' you'll probably want to organize your data so that it's all lumped together contiguously
' which would basically look like u0v0, u0v0, u0v0, u0v0, u1v1, u1v1, u1v1, u1v1 where each channel has
' a stride of 0 (is tightly packed) and it is only necessary to point to the appropriate offset into the data
glClientActiveTexture( GL_TEXTURE0 ) ' set the unit
glEnableClientState( GL_TEXTURE_COORD_ARRAY ) ' enable the texcoord pointer for this unit
glTexCoordPointer( 2, GL_FLOAT, 8, tc ) ' set the pointer
' stride is set to 8 so it skips over channel 1 and uses only channel 0
' repeat for the next unit
glClientActiveTexture( GL_TEXTURE1 )
glEnableClientState( GL_TEXTURE_COORD_ARRAY )
glTexCoordPointer( 2, GL_FLOAT, 8, tc+8 ) ' set it to use the second set of texture coordinates
This is a snippet from my engine's material code, basically shows how I handle the data.
|