locked
Fps is at ~60 all the time? RRS feed

  • Question

  • Hello,

    I'm total noob with XNA so please bear with me :)

    In xna beta 2, designer is now gone, so to access IsFixedTimeStep I have to do this in code:

     public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                content = new ContentManager(Services);

                this.IsFixedTimeStep = false;
           }

    Problem is that it always shows fps at around 60 no matter what I do - draw some 3d model or just empty screen.

    I know I'm missing something simple here, please help.. Btw, I'm using one of fps code examples found on this forum, so I don't think problem is in fps code itself.

    Thanks,
    ErnisJ

    Friday, November 3, 2006 10:06 AM

Answers

  • IsFixedTimeStep determines whether or not the Update call is made every Xth of a second or run continuously. What you need to do (I dont have an XNA PC here, so the property name is probably wrong, but i'm sure you'll find it) is set

    graphics.PreferWaitForVerticalTrace = false;

    graphics.ApplyChanges();

    That way the Draw command will run as fast and as often is it can.

     

    N

    Friday, November 3, 2006 10:12 AM

All replies

  • IsFixedTimeStep determines whether or not the Update call is made every Xth of a second or run continuously. What you need to do (I dont have an XNA PC here, so the property name is probably wrong, but i'm sure you'll find it) is set

    graphics.PreferWaitForVerticalTrace = false;

    graphics.ApplyChanges();

    That way the Draw command will run as fast and as often is it can.

     

    N

    Friday, November 3, 2006 10:12 AM
  • thanks thedo! that was it - property is called SynchronizeWithVerticalRetrace and fps now ~700 on my laptop displaying some 3d airplane from directx samples.
    Friday, November 3, 2006 10:24 AM
  • I wouldn't really call this a "problem" per se :P. It takes a lot of the load off your CPU and prevents any screen tearing by sync'ing the game's framerate to your monitor's refresh rate. You're probably better off leaving it on. Up to you, though :).
    Saturday, November 4, 2006 6:44 AM