Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Lesson 43: How texture is rendered

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Sh@dow   Members   

105
Like
0Likes
Like

Posted 17 June 2011 - 05:27 AM

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.

#2 lc_overlord   Members   

436
Like
0Likes
Like

Posted 17 June 2011 - 05:48 AM

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.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.