Sign in to follow this  

texture problem

This topic is 3659 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 used texture mapping and draw a cube , and it works perfectly.. However when i draw something before and after my cube my cube`s texture color changes into the next items color. ex.. if i draw a blue rectangle after my cube , texture turns to blue. does it make any sense? if so , how can i avoid that?

Share this post


Link to post
Share on other sites
This is most likely because you're not setting the color for the cube. Calling glColor4f(1.0f, 1.0f, 1.0f, 1.0f) before drawing the cube each frame will set the color to white, which will then be modulated with the applied texture.

Also, you should en-/disable texturing on an as-needed basis. If something doesn't have textures, disable texturing (glDisable(GL_TEXTURE_2D)), or you may end up with similarly strange results.

Share this post


Link to post
Share on other sites

This topic is 3659 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.

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