Archived

This topic is now archived and is closed to further replies.

2DamnFunky

debugin my direct x game

Recommended Posts

I''m in the process of making PacMan and originally i had created the beginings of it around teej''s tetris tutorial that I had previously started and finished. The basic framework to his tutorial was that of a FULLSCREEN EXCLUSIVE application. I soon found out, however, that it would be impossible for me to use the C++ debugger while running this exclusive mode app and although it didnt proove too much of a hindrance with Tetris, it is now trying my patience with PacMan. So I decided to develop a two mode application like the one listed in the tutorials section. So far so good. Pacman runs fine in both modes. However, whenever i try to use the debugger, my pacman app will run but it wont blit to the screen and instead remain as a little icon on my task bar. I need to be able to see what i am debugging. Does anyone know why this is happening? My code follows strictly from that of the tutorial and runs fine normally. Im not using any multithreading however as i only did part 1 of the 2 tutorials which to me seems sufficient. Plus in my game, im using timer code like this thisTickCount = timeGetTime(); G.diffTickCount = thisTickCount - lastTickCount; lastTickCount = thisTickCount; to monitor the time difference between frames to insure smooth animation. The problem is that when i exit to debug the i dont want the timer to still be counting because from my point of view the pacman app has temporarily stopped. Its important as my movement evaluation is directly linked with the difference in tick counts and so any huge delay between frames results in pacman travelling huge ammounts of distance. Any information would be greatly appreciated. Regards Aki

Share this post


Link to post
Share on other sites
When you start the debugger for a piece of code it typically stops at the first line of code and waits for you to start stepping through it. If this is what is happening to you, then you could set some break points in the code where you need to do some debug work and then let the program run until you get to those points. Once there you could look at what the program does while it is in that part of the program.

This works if you need to see what happens over a single iteration of the game loop. If you need to observe values and other behavior over several iterations of the game loop, I suggest that you try writting some strings out to a text file to observe what is going on while the game is running normally.

I hope this helps, and good luck with your game.

Chris

Share this post


Link to post
Share on other sites
If you want to debug your application I suggest you use log files and dbgview from www.sysinternals.com. (It is free)
Trying to see what happens is most often quite impractical and can often lead to wrong assumptions since you will not actually see what goes wrong. What you might see is the effects of the error which is not the same thing.

____________________________________________________________
Try RealityRift at www.planetrift.com

[edited by - MichaelT on January 20, 2003 4:32:20 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by 2DamnFunky
However, whenever i try to use the debugger, my pacman app will run but it wont blit to the screen and instead remain as a little icon on my task bar.


you''ve paused the program so that you can debug it, and since it''s not running, it cannot blit to screen. solutions include:
- running debugger and program side-by-side, each taking up half of the screen;
- using multimonitor setup;
- using remote debugging.
quote:

The problem is that when i exit to debug the i dont want the timer to still be counting because from my point of view the pacman app has temporarily stopped.

the best thing you can do is check frame time each frame, and if it is greater than let''s say 1 second, discard the frame or process it as if frame time was 0.1 seconds or so (10 fps).

Share this post


Link to post
Share on other sites