Sign in to follow this  
Sh@dow

Lesson 43: How texture is rendered

Recommended Posts

Sh@dow    105
In Lesson 43 to render a texture from free type font we are saying:
[code]

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);
[/code]

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
lc_overlord    436
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this