Ticket #4870: GLTeapot-integer-FPS.2.patch
File GLTeapot-integer-FPS.2.patch, 704 bytes (added by , 14 years ago) |
---|
-
src/apps/glteapot/FPS.cpp
94 94 FPS::drawCounter(GLfloat frameRate) 95 95 { 96 96 GLfloat pos = 0; 97 int ifps = (int) (frameRate * 10 + 0.5);97 int ifps = (int)frameRate; 98 98 99 99 int count = 0; 100 int number = 1 0;100 int number = 1; 101 101 while (ifps > number) { 102 102 number *= 10; 103 103 count++; … … 112 112 number /= 10; 113 113 } 114 114 115 pos -= 0.5;116 glBegin(GL_POINTS);117 glVertex2f(pos, -0.5);118 glEnd();119 115 pos += 0.5; 120 121 drawChar(pos, 0, (ifps / number) % 10);122 pos += 1.5;123 124 116 drawChar(pos, 0, 10); 125 117 pos += 1; 126 118 drawChar(pos, 0, 11);