0
\$\begingroup\$

I know how to debug step by step in XNA however when I do that the screen is gray and the console does not give out any output. This is a problem because it greatly limits my ability to find problems. Is there anyway around this?

\$\endgroup\$
1
\$\begingroup\$

Ideally, what you want to do is set a breakpoint in visual studio, run your game as normal, and then start stepping through when you reach the breakpoint. You can then hit "continue" when you want the game to run again. There is no way to simultaneously step through step by step and also have the game running as normal.

Another option is to print out debugging information to a log file, and read the file later (for instance, when you want to collect broad statistics about what's going on in the game) -- or drawing debugging information onscreen.

\$\endgroup\$
0
\$\begingroup\$

Running game "normally" is not possible, while stepping in debugger. However, game should continue normally, when you press continue, if it does not, then you have a bug.

You can output text to visual studio output window using

System.Diagnostics.Debug.WriteLine("It's me, Bugxor!");

If your output window is not open, you can open it from top menu "VIEW->Output" or keyboard shortcut "CTRL+W,O"

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.