Jump to content
  • Advertisement
Sign in to follow this  
McGrane

How to load in the alphabet

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

I know how to load in pictures and make them transparent, but its alot of pics to be loading ... what i want to know is can i make one file with all the letters, and than extract the pics from it? - If so how can this be done? Im using opengl,c++ and dev-c++ Any help will be appreciated ;)

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Make the texture containing all the characters, and then set texture coordinates for each quad to extract the appropriate texels. Remember that the lower-left corner of the texture has coordinates (0.0f, 0.0f) and the upper-right (1.0f, 1.0f), so you'll have to do some simple math to extract texels.

For example, for a 12x12 size character on a 256x256 texture might have its lower-left corner at texel (156, 26):

X: 1.0f / 256 * 156;
Y: 1.0f / 256 * 26;

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!