XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

FrameRate

Last post 09-04-2008 7:37 PM by jjackoway. 3 replies.
  • 09-04-2008 6:42 PM

    FrameRate

    My game (which, in order to do some tests, currently ONLY displays framerate) runs at about 60fps (even when I set fixedtimestep to false)...xna samples from the site, however, somehow have massive framerates upwards of 1000.

    what gives?

    My update method does nothing, and my draw method (in pseudocode):

    ++frameCount;

    if (frameCount % 30 == 0)
    {
    spriteBatch.Begin();
    spriteBatch.DrawString(0, 0, 1.0f / gameTime.ElapsedGameTime.TotalSeconds);
    spriteBatch.End();
    }


    This ain't fun. But you watch me, I'll get it done.
  • 09-04-2008 6:52 PM In reply to

    Re: FrameRate

    The update is locked in with IsFixedTimeStep which locks update and draw to a max of 60 fpx.   Also, the draw function is synced with the vertical retrace of the screen, limiting it to the vertical refresh hz of your monitor.  You need to turn those two off in there somewhere.

    IsFixedTimeStep = false;

    graphics.SynchronizeWithVerticalRetrace = false;

    ..shaders make you feel... powerful, or very very stupid.
    http://drjbn.spaces.live.com/
  • 09-04-2008 6:55 PM In reply to

    Re: FrameRate

    Most likely you still have vsync enabled (SynchronizeWithVerticalRetrace). That's a good thing for finished games, but not so good for performance measurement. See here: http://blogs.msdn.com/shawnhar/archive/2007/11/23/game-timing-in-xna-game-studio-2-0.aspx, and here: http://blogs.msdn.com/shawnhar/archive/2008/05/20/a-tale-of-many-haggis.aspx
    XNA Framework Developer - blog - homepage
  • 09-04-2008 7:37 PM In reply to

    Re: FrameRate

    that fixed it, thanks
    This ain't fun. But you watch me, I'll get it done.
Page 1 of 1 (4 items) Previous Next