summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/application.cpp7
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;