Jump to content
  • Advertisement
Sign in to follow this  
tasa

OpenGL OpenGL 3.2 font rendering

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

I searched for a tutorial on how to render a string/font at the top of my display output several hours. However I could only find tutorials that use OpenGl 2.1 functions, which are deprecated in OpenGl 3.2, but I'm not allowed to use deprecated functions. Can someone please help me (post a link to a tutorial which using OpenGl 3.2, some code or explain how to do this)? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Step 1: Grab BMFont.
Step 2: Save your font out to a nice BMFont file and texture.
Step 3: Load those files (really easy) and render them (fairly easy).

Share this post


Link to post
Share on other sites
Thanks for your fast answer. But can you explain how to render those files, because I do not have a clue?

Share this post


Link to post
Share on other sites
Well, my knowledge of 3.2 is very limited, let alone shaders, but assuming you are doing text in the old fixed pipeline way by means of textured quads, then, the first thing you should do is switch your immediate mode code to vertex buffers or arrays if needed.

Then on a vertex buffer multiply the vertex position against an orthographic projection matrix, to use the equivalent of what glOrtho would have produced, check the description part of the glOrtho documentation.

That's what I would/will try first.

Share this post


Link to post
Share on other sites
You can read the source code of GLGXFont.cpp:
http://texel3d.free.fr/projets/glgx/index.html

But maybe it's not the best solution.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net 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!