Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Quick and Dirty OpenGL font featuring the Super Mario font (NES)

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

Hi! I just wrote a quick font routine that has a built in font and requires no external data files. It uses the famous (?) Super Mario Bros-style font. It is useful for small projects and test applications, when writing a real font is too time/resource consuming. Can be used for retro and arcade games too. Sources and example available at: http://users.tkk.fi/~rsalmin2/font.tar.bz2 See the README for more information.
Sample code:
#include "font.h"

Font &font = Font::getInstance();
if(font.init() != 0) return -1;

font.drawString("the quick brown fox jumps over the lazy dog");
font.printf("string: %s  float: %f  integer: %d\nnewline ok", "omg!", 3.1415926535, 1234567890);

font.deinit();		// optional, only glDeleteTextures inside
The code is ugly but working. This was written in an hour or so. All feedback is welcome. -Riku rsalmin2(ät)cc.hut.fi

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!