Jump to content
  • Advertisement
Sign in to follow this  
barantamer

texture problem

This topic is 3852 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!