🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Lesson 43: How texture is rendered

Started by
0 comments, last by lc_overlord 13 years ago
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.
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.

This topic is closed to new replies.

Advertisement