PDA

View Full Version : Fixed FPS



06-26-2001, 03:05 AM
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 ?

royster
06-26-2001, 03:13 AM
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).

Rottbott
06-26-2001, 03:32 AM
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.

Julio
06-26-2001, 03:44 AM
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;

06-26-2001, 04:21 AM
Can you please give me some more details on this.

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

royster
06-26-2001, 04:22 AM
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.

royster
06-26-2001, 04:35 AM
Originally posted by zahid:
Can you please give me some more details on this.

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



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).]

06-26-2001, 09:49 PM
Thanks for the basic idea oyster.

06-27-2001, 03:06 PM
Originally posted by Rottbott:
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.
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.

06-27-2001, 03:07 PM
By renderer, I mean the video card. Sorry.