# HG changeset patch # User John Tsiombikas # Date 1444833962 -10800 # Node ID e8fc0c9754c9f602d02396e4e093ae38124dee88 # Parent 26513fdda566a103f798d9203e7d74a42a2eb9bb added fps counter diff -r 26513fdda566 -r e8fc0c9754c9 sdr/hblur.glsl --- a/sdr/hblur.glsl Thu Oct 17 08:19:56 2013 +0300 +++ b/sdr/hblur.glsl Wed Oct 14 17:46:02 2015 +0300 @@ -8,12 +8,13 @@ void main() { float pixw = 1.0 / texsize.x; + vec2 maxuv = size / texsize; vec3 texel = vec3(0.0, 0.0, 0.0); for(int i=0; i 1500) { + float fps = 1000.0 * (float)nframes / (float)dt; + prev_fps_upd = msec; + nframes = 0; + sprintf(fpsstr, "fps: %.1f", fps); + } + + print_string(1, 30, blur_type == BLUR_REG ? "Regular blur" : "Seperable blur"); + print_string(1, 5, fpsstr); glutSwapBuffers(); assert(glGetError() == GL_NO_ERROR); } -static void print_string(const char *str) +static void print_string(int x, int y, const char *str) { glPushAttrib(GL_ENABLE_BIT); @@ -163,7 +178,7 @@ glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); - glRasterPos2f(1, 1); + glRasterPos2f(x, y); glColor3f(1, 1, 0); while(*str) { glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *str++);