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

Started by
1 comment, last by Promit 16 years, 11 months ago
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!
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).
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.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement