Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a text (write on the screen) using standard OpenGL functions?

Tags:

opengl

delphi

I know I can do it with GLUT. But, I have a big project and I had problem adding GLUT (I am using Delphi) to it.

So, what other options do I have?

like image 220
Mahm00d Avatar asked Aug 14 '10 12:08

Mahm00d


3 Answers

You can't do it with standard OpenGL functions, unless you basically have textures with text in them, or a list of characters on a texture that you draw from. But don't reinvent the wheel - I would recommend FTGL for rendering text in an OpenGL view. It has several different rendering methods and takes care of things like kerning for you, supports unicode, and has good text metrics features too.

like image 159
AshleysBrain Avatar answered Sep 28 '22 07:09

AshleysBrain


Use TextSuite. http://textsuite.opengl24.de/

like image 22
someone Avatar answered Sep 28 '22 07:09

someone


Use FreeType to yield a bitmap given your text.

Edit: It is a mature cross platform library that brings a complete text display capabilities based on fonts including normal Windows TrueType fonts. Here is its definition from Wikipedia:

FreeType is a software library written in C that implements a font rasterization engine. It is used to rasterize characters into bitmaps and provides support for other font-related operations.

like image 23
mmonem Avatar answered Sep 28 '22 06:09

mmonem