I wonder how to limit FPS into simple 60 since now the game takes to much processor usage on Windows.
I wonder how to limit FPS into simple 60 since now the game takes to much processor usage on Windows.
This depends on the graphics library you are using.
If you are using SDL, you might want to take a look at SDL_gfx which has some nice frame regulation functions or you may try to implement them yourself like described here: http://lazyfoo.net/SDL_tutorials/lesson14/index.php (It's C++-Code but it's relatively easy to port this to Object Pascal.)
Edit: Sorry, I just noticed this was posted in the ZenGL forums. So my answer won't help you.
Last edited by Stoney; 05-02-2011 at 07:00 PM.
Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)
Programmer: A device for converting coffein into software.
Nah, not dependent on graphics library. I've found easiest way to insert TTimer on form with interval 17. It will be smooth, save your cpu and gpu and be very close to 60 fps.
You might be interested in this post: http://www.pascalgamedevelopment.com...ll=1#post52894
and perhaps a few above it
Only if this drivers configured to do not use VSync, or if drivers just a cr*pOriginally Posted by gintasdx
SDL_Delay is not good idea because it's just a Sleep function under Windows, and it far from "constant value". But yeah, you can limit your fps to ~61 with this function.Originally Posted by gintasdx
Well actually you don't need to convert any C++ code. There is good examples of limiting FPS using SDL_Delay(); in JEDI-SDL package,SDLSpriteEngine demos folder.
Bookmarks