Fixed FPS

English is my second language so i hope i can explain this to you …

How can i keep my FPS fixed. Like when i view my program in full screen mode it runs a bit slow than window mode. Plus it’s tends to be slower when more objects are in the scean !!!

Any code ?

I have also found this.
I use Win2000 and another thing I have found is that when I was moving my object(car) is was jerking even though I have code which determines the amount to move each frame by the frames per second.
My Frames per second counter tells me that my program is running at 100 fps approx which doesnt make sense as it should be 70 because thats what my refresh rate of the monitor is set to. I have found that when listening to music in the background via Windows Media Player my frames per second drops down to 70 which then makes everything run smooth. Anyone have any ideas about this, is it something to do with Windows 2000 or my Nvidia drivers(latest reference drivers).

Have you got Wait For Vertical Blank/Sync enabled?

Lots of people turn it off for some reason, despite that fact that having an FPS over the monitor refresh rate is utterly pointless.

Why lock the framerate? Why not just use frame based modeling. Everything will run the same speed on every computer, and unlike locking the frame rate, it will run smoother on faster pc’s’. should look something like this:
StartTime=timeGetTime()
GameLoop();
EndTime=timeGetTme();
delta=EndTime-StartTime;
object_x+=object_speed*delta;

Can you please give me some more details on this.

Mabey some URL to some tutorial/code on this matter ???

Yes Vertical Blank is enabled, I have also tried it disabled but it made no difference. I cant understand why Loading Windows Media Player makes it run fine. I think I will shift some of my code around and also check that my timing code is working correctly.

Originally posted by zahid:
[b]Can you please give me some more details on this.

Mabey some URL to some tutorial/code on this matter ???

[/b]

What you need to do is get yourself some code to determine how fast your computer takes to compute each frame. You then Minus this value from the previous frame time and you are left with the current frame time which can be used to calculate the distance to move your object per frame. If you do a search on this forum you should find lots of information on frame timing.

Julio posted the order things should be programmed.

[This message has been edited by royster (edited 06-26-2001).]

Thanks for the basic idea oyster.

Originally posted by Rottbott:
[b]Have you got Wait For Vertical Blank/Sync enabled?

Lots of people turn it off for some reason, despite that fact that having an FPS over the monitor refresh rate is utterly pointless.[/b]

What VSync does is force the renderer to wait until the monitor’s DAC is reset to begin drawing. That means that if the program is out of sync with the monitor (which it probably is) your program will be slowed down (It has to wait for the monitor before it can continue doing whatever it does). However, by disabling VSync this problem is elimanated (sp?) The side-effect of this is that your animation might not be as smooth as possible. I hope that cleared some things up.

By renderer, I mean the video card. Sorry.