Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Hedos

Textures dimensions, for a GUI

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

Hey, I''m currently working on a GUI for my game, it will consists of some windows with button and text.. Right now I''m doing everything with colored polygons, but now I would like to use textures. What I''ve thought about is having a 512x512 or 256x256 texture, containing different pictures to represent buttons, borders, corners, check boxes, etc... But the problem is I don''t really know how to manage the different position of the images inside my textures with openGL.. Anyone know how could I do that? Maybe by using something like a RECT struct? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Well, since 0,0 is the lower-left point of the texture and 1,1 is the upper-right, just find the coordinates representing the extents of the image within the texture. When rendering the button or whatever, just use those values for the texture coordinates. . .

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!