This is part of the 3d Buzz " Intro into Game dev" series. I cant find any help on their site. Im trying to show the FPS on the console but every time, I try, it display 0 fps.
If i use cout << (timeGetTime() - startTime) << " frames per second" << endl; ---it works fine. but its in milliseconds. Any help will be appericated.
When working with integers, try to avoid such things as a/(b/c). Integer division discards a lot of information. Always try to perform as few divisions as possible and as late in the expression as possible.
Instead of frameCount / ((timeGetTime() - startTime) / 1000)
try frameCount * 1000 / (timeGetTime() - startTime)
Except in the case of integer overflow (which can often be accounted for), multiplication doesn't discard any information.