Mercurial > hg > forks > gldragon
comparison glxdragon.cpp @ 15:2d2aadfa3df3
Fix calculation of totalFrames.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 29 Oct 2019 12:51:25 +0200 |
parents | 62be2036f604 |
children | c134a186912f |
comparison
equal
deleted
inserted
replaced
14:62be2036f604 | 15:2d2aadfa3df3 |
---|---|
587 | 587 |
588 // Rotate for 2 degrees | 588 // Rotate for 2 degrees |
589 glRotatef(2.0f, 0, 1, 0); | 589 glRotatef(2.0f, 0, 1, 0); |
590 | 590 |
591 // Return true if a full rotation was done | 591 // Return true if a full rotation was done |
592 totalFrames++; | |
592 if (cycleFrames++ == SET_FRAMES) | 593 if (cycleFrames++ == SET_FRAMES) |
593 { | 594 { |
594 // Reset cycleFrames | 595 // Reset cycleFrames |
595 totalFrames += cycleFrames; | |
596 cycleFrames = 0; | 596 cycleFrames = 0; |
597 | 597 |
598 // Get the time it took to render a full turn | 598 // Get the time it took to render a full turn |
599 int cycleEnd = SDL_GetTicks(); | 599 int cycleEnd = SDL_GetTicks(); |
600 double cycleTime = cycleEnd - cycleStart; | 600 double cycleTime = cycleEnd - cycleStart; |