Jump to content
  • Advertisement

Archived

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

Dtag

glActiveTextureARB

This topic is 5734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
One is for arrays (eg glTexCoordPointer()), the other is for single instance parameters (eg glTexCoord2d()).

Crispy

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!