Advertisement Jump to content


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


Textures dimensions, for a GUI

This topic is 5367 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
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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!