• Advertisement
Sign in to follow this  

Lesson 43: How texture is rendered

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

In Lesson 43 to render a texture from free type font we are saying:


glBegin(GL_QUADS);
glTexCoord2d(0,0); glVertex2d(0,bitmap.rows);
glTexCoord2d(0,y); glVertex2d(0,0);

glTexCoord2d(x,y); glVertex2d(bitmap.width,0);
glTexCoord2d(x,0); glVertex2d(bitmap.width,bitmap.rows);


I can't understand what does this code do? We are drawing here two quads: first has all x = 0; What does this supposed to mean?
Thanks.

Share this post


Link to post
Share on other sites
Advertisement
no it's only one quad, if your doing texturing you need at least two sets of coordinates for each vertex, the first set given by glTexCoord2d signifies where on the texture you should read from and the second given by glVertex2d is the position on the screen, it's all really simple once you get a hang of it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement