Jump to content
  • Advertisement
Sign in to follow this  
svnstrk

OpenGL OpenGL Texture problem

This topic is 2525 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 have problem with my program. I tried to render a bunch of lines followed by a textured quads. here is the snipplet:



glBegin(GL_LINES);
{
glVertex3f(800, 800, -0.5);
glVertex3f(800, -800, -0.5);
}
glEnd();

glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 1);

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

glBegin(GL_QUADS);
{
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);
}
glEnd();

glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);



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
Advertisement
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!