Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to make a FPS and debugging info overlay similar to the one in the bottom of this image but without using SDKTrays or OIS, can anyone give me a snippet code (C++) for it. Also I want to customize its look, I mean changing its font and background color. Thanks in advance.

share|improve this question
Please choose Ogre or mOgre. They're different bindings of the same engine. You can't choose C++ and C# at the same time. – Gustavo Maciel May 1 '12 at 3:36

Simple as adding the 40 lines class file to your project loading a font of your choice and calling TextRenderer::getSingleton().printf("text", "Last FPS: %f", renderwindow->getLastFPS()); from your update method body.

Don't forget to initialize and remove the text overlay!


You can change it color on the initialization of the overlay: TextRenderer::getSingleton().addTextBox("text", "Last FPS:", 10, 10, 100, 20, Ogre::ColourValue(redValue, greenValue, blueValue, alphaValue);

And the font on the fontdef file.

Not sure about the background, but you can easily add another overlay behind the text modifying the addTextBox method.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.