Archived

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

AyaKoshigaya

VertexArray + MultiTexturing

Recommended Posts

Luminous Blue    122
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 );



Share this post


Link to post
Share on other sites