Rendering text

I hope this question is not too simple to be post in the advanced forum.

How can I render centered text in OpenGL? (in windows, with bitmap fonts created with using wglUseFontBitmaps)

I can’t know the exact lenght of the text. I’ve thought that I could render the text once and check the raster position. But it must be some simpler way.

Hey Martinho_, you might try the windows forum. I’ve seen this question before. You’ll need the Windows API for this, in addition to any transformations you may be applying in the GL. Look for font and text functions in MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_9r77.asp