Jump to content
  • Advertisement

Archived

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

pokkelipoo

OpenGL Creating bitmap fonts in OpenGL

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

Hello, I'm currently creating a bitmap font system to my Java game engine. I've created a FontCreator-class which renders any Java's font to a bitmap and stores it in a file. The font is loaded to the game as a GLFont, which contains the font bitmap as a texture and some other information about the font, e.g. the width of each character. I was wondering should I create a own texture for every char in the font (ascii fonts), or should I draw one character at a time directly from the big texture. And I believe it would make sense to pre-render the text string I want to display to a buffer rather than rendering the in real-time, but I don't know how to do this in OpenGL. I'd be very grateful for code examples, since I'm just learning OpenGL. Thanks. [edited by - pokkelipoo on January 5, 2004 4:27:09 PM]

Share this post


Link to post
Share on other sites
Advertisement
It is much much much much more efficient to render text using one big texture than to create a texture for each character. glBindTexture is a fairly expensive operation after all. I'd give you some source code, but mine's all in C++.

______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________


[edited by - Thunder_Hawk on January 5, 2004 4:34:59 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!