   Opengl font
  Guys, it might be a stupid question, but how do you print out messages on the screen?I used to use Nehe's methods, but all of fonts in his tutorials use the display lists, which is depreciated.I'm using SDL + Opengl to develop my program, but, Pure OpenGL way is also OK. Thanks in advance.   
  A common solution is to create a texture from the font, and then render each character as a quad with appropriate texture coordinates. There are applications available (such as the AngelCode bitmap font generator) that will create a texture and the necessary metadata from an existing font.There are also libraries available (such as SDL_ttf) that will render text to a surface using a specified font. You can then create a texture from that surface and render using normal methods.There may be other libraries/engines/frameworks/etc. that support text rendering to various degrees (in particular, you might take a look at some of the GUI libraries that are available).AFAIK the 'textured quad' method is still fairly standard, although there may be other commonly used techniques for text rendering that I'm not aware of.   ;Quote:Original post by jykThere are also libraries available (such as SDL_ttf) that will render text to a surface using a specified font. You can then create a texture from that surface and render using normal methods..Can I really do this? How?   ;  Thanks a lot. Got a solution when I searched the forum.   ;Quote:Can I really do this?Um...sure!Quote:How?For that particular approach, there are basically two steps.First, you render the text to a surface using the SDL_ttf library. This should be straightforward - I assume SDL_ttf comes with documentation, but if not, you should be able to find some examples here on the forums.Second, you create a texture from the surface. This is less straightforward, but it can be done - you basically have to get the raw surface data into a form that OpenGL can work with, and then you can upload the texture data in the usual way.Honestly, I'm not sure if people actually do it this way very often. If the text is changing frequently (e.g. an FPS readout), this method might be somewhat inefficient due to having to repeatedly re-upload the texture. For this reason (and others), I think the 'textured quad' method is more commonly used.I should also mention that I've never actually tried the method described above; I'm just assuming it would work. I know a lot of people use SDL_ttf, but they might also be using SDL's software blitting functionality (which makes the process a little more straightforward).   ;Quote:Thanks a lot. Got a solution when I searched the forum.Good, glad you found a solution :)   ;  FTGL works great and you can render directly to screen (with high quality text antialiasing), create textures, or have it create extruded geometry.  It uses freetype as the font engine so you can use TrueType and a bunch of other forn formats.  And it's free--LGPL license.http://homepages.paradise.net.nz/henryj/code/   ;  Does FTGL support font scaling on the fly? I want that message's height would be 1/10 from the windows height independently on the windows height.   ;Quote:Original post by PruneFTGL works great and you can render directly to screen (with high quality text antialiasing), create textures, or have it create extruded geometry.  It uses freetype as the font engine so you can use TrueType and a bunch of other forn formats.  And it's free--LGPL license.http://homepages.paradise.net.nz/henryj/code/Man, I could not for the life of me get FTGL to compile and link.  I think the problem was actually getting Freetype compiled and linked.  Any suggestions on how to install this properly?   