Sign in to follow this  
guvidu

MultiTexture with Normal Texture = Problem - Pls Help

Recommended Posts

Ok - so here is my code: glBindTexture(GL_TEXTURE_2D, g_Jpeg.TextureDataArray[0]); glBegin(GL_QUADS); glTexCoord2f(1.0f,1.0f); glVertex3f(1.0f,1.0f,0.0f); glTexCoord2f(0.0f,1.0f); glVertex3f(0.0f,1.0f,0.0f); glTexCoord2f(0.0f,0.0f); glVertex3f(0.0f,0.0f,0.0f); glTexCoord2f(1.0f,0.0f); glVertex3f(1.0f,0.0f,0.0f); glEnd(); //MULTI TEXTURING PROCEDURE glTranslatef(1.5f,0.0f,0.0f); glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, g_Jpeg.TextureDataArray[1]); glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, g_Jpeg.TextureDataArray[2]); glBegin(GL_QUADS); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f,1.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0f,1.0f); glVertex3f(1.0f,1.0f,0.0f); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f,1.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0f,1.0f); glVertex3f(0.0f,1.0f,0.0f); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f,0.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0f,0.0f); glVertex3f(0.0f,0.0f,0.0f); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f,0.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0f,0.0f); glVertex3f(1.0f,0.0f,0.0f); glEnd(); The problem is that when i render with multi texture the image from the normal texture is the first image from multitexture. so the image from here->g_Jpeg.TextureDataArray[0] becomes the image from here g_Jpeg.TextureDataArray[1]. Strange. When i comment this line glActiveTextureARB(GL_TEXTURE1_ARB); everything simes to work fine. Can you tell me where is the bug in my code. Thx!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this