Skip to main content
GameDev.net gamedev.net
🔒 Locked

Frame Timing and Debugging

Started by 2DamnFunky Mar 9, 2003 at 3:41 PM 0 replies 150+ views
Original Post
2DamnFunky
2DamnFunky
Hi there, Im trying to debug my game using the visual C++ debugger however im finding it impossible to ''break'' the execution of my code to snoop around and then to recomence execution without my game timer having advanced by however long i was snooping around for. This results in all the sprites litterally jumping to new positions as there movement is dependant on this timer. I tried to implement some code in my message handler that would detect when my game was or wasnt the active window. When it would become inactive it would set a flag so that when its activated again the frame timer would be tricked into thinking only 30ms had passed since the end of the last frame. This works fine when i play the game normally but it seems that MS visual studio doesnt deactivate the games window when i use the break command thus not setting the flag and thus allowing for a huge time span to be recorded in my global timer variable. How then do i solve this problem. Any help would be greatly appreciated.
Osc
Osc
I wrap up all my timer code behind a global scope object that knows how long the last frame really took, then cap the value that is exposed to the client code (10fps works for me).

No matter how long I spend in the debugger, the game thinks 0.1 seconds has elapsed :-)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.