PDA

View Full Version : Getting width and height of a string in OpenGL+GLX?



paukku92
October 3rd, 2007, 01:19 PM
I'm making a game with OpenGL. I'm using GLX for getting the fonts, rendering fonts goes ok. I would like to render the text in middle of a button with this:

X=ButtonX/2-TextWidth/2
Y=ButtonY/2-TextHeight/2

The only problem is how to get the width and height of the specified string.