Skip to main content
gamedev.net
🔒 Locked

VertexArray + MultiTexturing

Started by AyaKoshigaya Aug 7, 2003 at 5:50 PM 1 replies 300+ views
Original Post
AyaKoshigaya
AyaKoshigaya
Hi, does anyone know how I can use VertexArrays with MultiTexturing??? Especially, how can I tell the VertexArray the TextureCoordinates für the 2nd TMU??? Au''revoir, Aya~
I aim for my endless Dreams and I know they will come true!
Luminous Blue
Luminous Blue
Hi


for TU 0
glClientActiveTextureARB( GL_TEXTURE0_ARB );
glTexCoordPointer( 2, GL_FLOAT, 0, pTexCoords );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glActiveTextureARB( GL_TEXTURE0_ARB);
glEnable( GL_TEXTURE_2D );

bind texture

next TU 1

glClientActiveTextureARB( GL_TEXTURE1_ARB );
glTexCoordPointer( 2, GL_FLOAT, 0, pTexCoords );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glActiveTextureARB( GL_TEXTURE1_ARB);
glEnable( GL_TEXTURE_2D );

bind texture

next

drawelements ...


after all


// Disable TU''S
glActiveTextureARB( GL_TEXTURE1_ARB );
glDisable( GL_TEXTURE_2D );
//glActiveTextureARB( GL_TEXTURE0_ARB );
//glDisable( GL_TEXTURE_2D );
// Enable TU 0 as default
glActiveTextureARB( GL_TEXTURE0_ARB );
glEnable( GL_TEXTURE_2D );



AyaKoshigaya
AyaKoshigaya
Hi,

thanks a lot, it worked very well

Au''revoir,
Aya~
I aim for my endless Dreams and I know they will come true!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.