Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

OpenGL OpenGL Texture problem

This topic is 2833 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


I have problem with my program. I tried to render a bunch of lines followed by a textured quads. here is the snipplet:

glVertex3f(800, 800, -0.5);
glVertex3f(800, -800, -0.5);

glBindTexture(GL_TEXTURE_2D, 1);

// necessary color definition, not sure why
glColor3f(1.0, 1.0, 1.0);

glTexCoord2f(1.0, 0.0);
glVertex3f(-20.0, -20.0, 0.0f);
glTexCoord2f(0.0, 0.0);
glVertex3f(-20.0, 20.0, 0.0f);
glTexCoord2f(0.0, 1.0);
glVertex3f(20.0, 20.0, 0.0f);
glTexCoord2f(1.0, 1.0);
glVertex3f(20.0, -20.0 ,0.0f);

glBindTexture(GL_TEXTURE_2D, 0);

however the texture is not rendered. But if i did it the other way around (render the textured quad then the line), it turned out to be ok. im not sure why this is happened, any1 have a clue? thanks in advance

ps: i enabled blending, line smoothing, but disabling it doesn't help.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!