| 288 | } |
| 289 | |
| 290 | void computeFPS() |
| 291 | { |
| 292 | frameCount++; |
| 293 | fpsCount++; |
| 294 | |
| 295 | if (fpsCount == fpsLimit) { |
| 296 | char fps[256]; |
| 297 | float ifps = 1.f / (sdkGetAverageTimerValue(&timer) / 1000.f); |
| 298 | sprintf(fps, "CUDA Marching Cubes: %3.1f fps", ifps); |
| 299 | |
| 300 | glutSetWindowTitle(fps); |
| 301 | fpsCount = 0; |
| 302 | |
| 303 | fpsLimit = ftoi(MAX(1.f, ifps)); |
| 304 | sdkResetTimer(&timer); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | //////////////////////////////////////////////////////////////////////////////// |
| 309 | // Load raw data from disk |
no test coverage detected