diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-05-22 15:04:04 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-05-22 15:04:04 +0200 |
commit | 332bfa22a6319cacee88883ef177ff2b52b509c0 (patch) | |
tree | aa514648dcdd3cf33cc6dcee2e998ae41f2243e8 | |
parent | 98f0d881978eb1c35c9bc4ab7d951e22f873102b (diff) |
Replaced snprintf with boost::format.
-rw-r--r-- | engine/application.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/engine/application.cpp b/engine/application.cpp index 2ef8e79..e814ac2 100644 --- a/engine/application.cpp +++ b/engine/application.cpp @@ -75,6 +75,7 @@ class BulletPattern2 : public BulletPattern { } }; +#include <boost/format.hpp> Application::Application() { // Initialize SDL @@ -224,8 +225,6 @@ void Application::main_loop(unsigned int tick, unsigned int step) { glDisable(GL_TEXTURE_2D); glColor4f(1, 1, 0, 1); - char s[0xff]; - if(tick - lastframes >= 1000) { fps = (float)frames * ((float)(tick - lastframes) / 1000.0f); frames = 1; @@ -233,9 +232,9 @@ void Application::main_loop(unsigned int tick, unsigned int step) { } else { frames++; } - snprintf(s, 0xff, "FPS: %.2f", fps); + glRasterPos2f(Config::fps_x, Config::fps_y); - font->Render(s); + font->Render((boost::format("FPS: %.2f") % fps).str().c_str()); float v_x = Config::window_w * (Config::viewport_x + xo) / (1 + 2 * xo); float v_y = Config::window_h * Config::viewport_y; |