Jump to content
  • Advertisement
Sign in to follow this  
sofakng

What is "text-emulation" via OpenGL or DirectX? Do I need to use this?

This topic is 4148 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'd like to create a hybrid text/graphics game and I've heard the term "text-emulation" used before. What does it mean? One specific example is the game "Dwarf Fortress" which is a text-based game (eg. no graphics what-so-ever) but it uses OpenGL along with font (bitmap?) files so you can actually replace characters with images. Anyways, I'd like to create a Nethack type of game but add in particle effects and have full GUI support. (this probably sounds strange to you, but hey, it's my idea!) :) So what is text-emulation via DirectX/OpenGL and do I need to use it? Links to any articles/information would be GREATLY appriciated! Thanks!

Share this post


Link to post
Share on other sites
Advertisement
I believe dwarf fortress uses textured quads. You have a texture file containing the information for each character, draw a quad, and apply the appropriate texture coordinates to the quad according to the letter you wish to draw. This has several advantages - you can easily change character sets and expect it to work if the new texture has the same proportions, it's fast to draw if you have 3d acceleration, and you can scale the text to be any size you want.

GPWiki has a good tutorial on this subject. I made a simple application a year or so ago (I don't believe it is commented, clean, or otherwise very good, but it should give you an idea of what to do).

Share this post


Link to post
Share on other sites
Quote:
Original post by CrimsonSun
you can scale the text to be any size you want.
You don't want to do that, unless you're applying a more sophisticated custom algorithm to do the scaling. Standard texture filtering will make a mess of it.

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!