Jump to content
  • Advertisement
Sign in to follow this  
BrknPhoenix

OpenGL Fonts! Gah!

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

Alright, well I was all ready to start making a game a while back, had all the necessary skills under my belt, then I decide hey... I should use OpenGL. Well, it's been a complicated endeavor but I've learned quite a bit. Finally once I got a good skeleton for my game set up, I think I'm ready to go. But then I realize... Fonts. So I try to display TTF fonts the way I always did before I started using OpenGL. Crash. OpenGL no likey. I tried compiling GLFont2 into my program... the GLFont2 file generated compile errors. Roar >_< So yes, fonts... I'm not looking to make a big learning experience out of it right now, I just need to be able to display nice looking TTF fonts without having to go through a thousand hassles. Does anyone have a good direction to point me in? edit: I would like to add that I only need 2d text, so I don't need anything fancy-ish. another edit: And I realize there is a question in the FAQ for this board that links to a NeHe tutorial, but I didn't find that particularly to my tastes to use....

Share this post


Link to post
Share on other sites
Advertisement
If you can, use whatever you were using before, but just draw it to a texture and put the texture on a quad and draw. It works for me while using SDL_ttf to render the text.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ezbez
If you can, use whatever you were using before, but just draw it to a texture and put the texture on a quad and draw. It works for me while using SDL_ttf to render the text.


Well, what I was using before was a library that used the FreeType Library to display fonts, but now that library doesn't work with OpenGL and the FreeType library I can't even get to compile by itself in the first place, lol.

As for SDL... What all is involved with that. I've heard it a lot but I've got no idea what it is :p

Share this post


Link to post
Share on other sites
SDL stands for Simple DirectMedia Layer. It is a handy library that covers window creation, input from keyboards/mice/joysticks, audio, threading, and cds. It can render to the window it creates, but its not very fast, so most larger projects use OpenGL to render to its window. SDL is very portable and works on most major OSes(Linux, Mac, Windows, BSD, some others). A link to the homepage.

There is an extension library for SDL that is titled SDL_ttf. It is a wrapper around FreeType and is very easy to use. It renders to an SDL_Surface, which is just an image in SDL. You would need to use the entire SDL library and SDL_ttf in order for this to work. SDL is a fairly large library, and would add a megabyte or two to the size of your game.

And what do you mean by "doesn't work with OpenGL"? Could you show us some errors and code?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try FTGL, it's nice and simple http://gltt.sourceforge.net/20011027_000000.html

Share this post


Link to post
Share on other sites
Quote:
Original post by Ezbez
And what do you mean by "doesn't work with OpenGL"? Could you show us some errors and code?


I use the Allegro game programming library to handle some of my stuff, like input devices, sound, and so forth. So I used an extension library, AllegroFont, to display fonts. I got it to work perfectly, but then when I switched to OpenGL, trying to draw with AllegroFont resulted in a crash. It's a shame, because it was an incredibly easy library to use, and it worked off of FreeType. Sorry, I don't have the code with it in it :( I trashed it awhile ago.

And thanks for the suggestions guys, I'll check them out

Share this post


Link to post
Share on other sites
Does AllegroFont render the font directly to the screen?

I searched google and found that Allegro seems to have some font capabilities for OpenGL. Check out this page.

Share this post


Link to post
Share on other sites
Quote:
Original post by mrbastard
I second FTGL - it's great.
Thirded. Working with it on Mac/Linux/Windows and it is great.

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.

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!