Skip to main content
gamedev.net
🔒 Locked

Lesson 43: How texture is rendered

Started by Sh@dow Jun 17, 2011 at 11:27 AM 0 replies 10.8k views
Original Post
Sh@dow
Sh@dow
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.
lc_overlord
lc_overlord
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.