glActiveTextureARB

Started by
4 comments, last by Dtag 21 years, 2 months ago
Hi... I Currently have a problem with the glActiveTextureARB function. I have a VertexBuffer for my geometry and 2 Tex Coord buffers for Lightmap + Texture... Iam absolutely sure that the tex coords in my buffers are right. My problem is that if i want to use both in different Textures (TEXTURE0 and TEXTURE1 which is a must for Lightmapped Textured), one of them doesnt work ( looks completely wrong ) So I tried to draw one by one This does work: glActiveTextureARB(GL_TEXTURE0_ARB); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, sizeof(CVector2), m_pTexCoords2); // m_pTexCoords2 is my Lightmap Texture Coordinate buffer glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_Lightmaps[pFace->iLightmapID]); glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); glDrawArrays(...); However this doesnt work glActiveTextureARB(GL_TEXTURE1_ARB); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, sizeof(CVector2), m_pTexCoords2); // m_pTexCoords2 is my Lightmap Texture Coordinate buffer glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_Lightmaps[pFace->iLightmapID]); glActiveTextureARB(GL_TEXTURE0_ARB); glDisable(GL_TEXTURE_2D); glDrawArrays(...); I need to get it working for both Texture slots. Can anyone give me a hint whats wrong? Thanks
Advertisement
EnableClientState and TexCoordPointer require you to use glClientActiveTexture.
Hmm whats the difference between glActiveTextureARB and glClientActiveTextureARB?
One is for arrays (eg glTexCoordPointer()), the other is for single instance parameters (eg glTexCoord2d()).

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Thanks alot! It works now
Oh.. and FYI ( I figured this out the hard way ), don''t enable arrayPointers that you don''t use. If you do, when you try to use glDrawArrays or simular functions, the program will crash.

This topic is closed to new replies.

Advertisement