0
\$\begingroup\$

How would I go about creating a menu system with fonts in OpenGL? I want to make a dungeon crawler and will need a menu for inventory and stats for the weapons. I can draw a world made out of blocks ok but I'm not quite sure how to do this.

I think I need to use the matrix that glortho applies to the matrix stack. Specifically I'm using WebGL and I don't have access to fonts so it seems like I have to create my own.

Any help with how I would go about doing this would be appreciated.

\$\endgroup\$
2

3 Answers 3

2
\$\begingroup\$

OpenGL know nothing of fonts, so you have two choices. Either use bitmap fonts (a font written into a texture) or use Canvas/HTML to display your text.

Most regular OpenGL games uses bitmap fonts.

\$\endgroup\$
1
\$\begingroup\$

If you're using WebGL, using the properties of the underlying 'canvas' element from which you created the context from to draw text. Don't make it harder than it needs to be until it needs to be.

\$\endgroup\$
-2
\$\begingroup\$

Maybe I just don't understand your question, but if you want to draw text, you can use function glutBitmapCharacter.

\$\endgroup\$
2
  • \$\begingroup\$ Assuming he is even using GLUT \$\endgroup\$ Commented May 2, 2011 at 15:15
  • \$\begingroup\$ GLUT isn't available for WebGL. \$\endgroup\$
    – Xavier
    Commented May 2, 2011 at 22:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .