PDA

View Full Version : glActiveTextureARB and glClientActiveTextureARB



xanatose
03-17-2004, 06:35 AM
Whats the difference between

glActiveTextureARB

and

glClientActiveTextureARB
?

Relic
03-17-2004, 07:58 AM
glActiveTextureARB switches the texture unit, glClientActiveTextureARB switches between texture coordinate arrays.

Use the first for downloading textures to different units for multitexturing and the second to specify texture coordinate pointers when drawing with vertex arrays.

Also glEnable and glDisable work in the respective active units or client arrays only, e.g. glEnable(GL_TEXTURE_2D) is per unit or glEnableClientState(GL_TEXTURE_COORD_ARRAY) is per active texcoord array.

Corrail
03-17-2004, 01:30 PM
glClientActiveTextureARB is used when you work with vertex arrays. There's only glTexCoordPointer for texturce coordinates. So if you want to set the texture coordinate pointer for the 3rd texture coordinate you have to use:

glClientActiveTextureARB(GL_TEXTURE2);
glTexCoordPointer(...);

Otherwise if you want to access the texture objects you use glActiveTextureARB. If you want to bind a texture object to texture unit 2 you have to use:

glActiveTextureARB(GL_TEXTURE1);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, my_tex_obj);

glClientActiveTextureARB does NOT affect the the current texture unit for binding texture objects and the other way round glActiveTextureARB does NOT affect the current texture coordinate set for bind texture coordinate pointers.

Note: glTexCoord ALWAYS updates the texture coordinate of the 1 texture unit (GL_TEXTURE0)

xanatose
03-17-2004, 05:36 PM
Thank you all