Weird DeWitter's Game Loop Problem

Started by
12 comments, last by handoman 11 years, 2 months ago

I decided to created a log and output the time since each update into a file... if the game loop was working right, the time time between each frame should be the same right? well there were slightly different:(here is just some of the times)

0.0167939
0.0197271
0.0204671
0.0206342
0.0188694
0.0201671
0.0196725
0.0219421
0.0180132
0.020587
0.0197747
are these times close enough, or should the game loop really be calling the update equally every time??
Advertisement

The actual time between frames?

They will generally be close as long as nothing is moving around on your screen, and as long as you are not writing times to a file every frame.

Print to the debug console—it is still laggy but less so than writing to a file.

OutputDebugString().

Also, waiting for v-sync can cause different delays between frames.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

ah okay, I'm not gunna bother with the code anymore, the game loop and timing are pretty precise ..gunna go try it on other computers to be sure its not just mine... or I'll just have to play with Chrome open all the time! thanks for the help guys, Ill probly be back when it doesnt work

okay, I actually now concluded that its not the code...its my comp:
I ran the exe(not with code::blocks) on my pc, and the situation is the same. but then I take it to my dad's laptop and it runs normal and smooth no matter what else is open! gunna start comparing all of our setting and stuff.

This topic is closed to new replies.

Advertisement