Game loop called once - then never again.

May 1, 2010 at 9:50 PM

Converted my app in about 2 hours, very easy, but here's my problem: after the LoadContent, silversprite calls Update once, then Draw once, then never calls them again.The app itself is still running, and that's verified both by VS and the fact that its music is playing in the background, but the breakpoints that are on the first lines of Update and Draw are never hit again.As I'd expect under those conditions, I end up with a blank screen with the audio from MediaPlayer running in the background.

Has anyone run into anything like this before or have any recommended troubleshooting?

Thanks,

Aaron

May 2, 2010 at 8:42 PM

   
if (!InitGraphicsMode(1280, 720, false))
{
       if (!InitGraphicsMode(1024, 768, true))
       {
                if (!InitGraphicsMode(800, 600, true))
                {
                            if (!InitGraphicsMode(640, 480, true))
                            {
                                this.Exit();
                            }
                 }
       }
}

 

 

Learn from my mistakes -- even if you've created code that will exit the application on initialization without remembering that you ever coded it (probably because I borrowed it from someone else!), SilverSprite will STILL make through the first Draw/Update, leaving you very confused as to what has just occurred. I think leaving the mediaplayer active on exit is probably a bug though.