Ticket #4870: GLTeapot-integer-FPS.patch

File GLTeapot-integer-FPS.patch, 650 bytes (added by mmadia, 14 years ago)

Truncates FPS to an integer value

  • src/apps/glteapot/FPS.cpp

     
    9494FPS::drawCounter(GLfloat frameRate)
    9595{
    9696    GLfloat pos = 0;
    97     int ifps = (int)(frameRate * 10 + 0.5);
     97    int ifps = (int)(frameRate * 10);
    9898
    9999    int count = 0;
    100100    int number = 10;
     
    111111            break;
    112112        number /= 10;
    113113    }
    114 
    115     pos -= 0.5;
    116     glBegin(GL_POINTS);
    117     glVertex2f(pos, -0.5);
    118     glEnd();
     114   
    119115    pos += 0.5;
    120 
    121     drawChar(pos, 0, (ifps / number) % 10);
    122     pos += 1.5;
    123 
    124116    drawChar(pos, 0, 10);
    125117    pos += 1;
    126118    drawChar(pos, 0, 11);