FPS (60)
Blitz3D Forums/Blitz3D Programming/FPS (60)
| ||
Hello, someone please tell me how to implement a code of not passing the 60 frames per second. A greeting. |
| ||
Maybe this code entry helps? http://www.blitzmax.com/codearcs/codearcs.php?code=9 |
| ||
There are a couple ways:global T:TTimer=CreateTimer(60) While not Keydown(KEY_ESCAPE) WaitEvent() if EventSource()=T RunGame() Wend Function RunGame() ... End Function or look at implementing an actually timing system which is a lot more complicated but gives you much more control over smoothing etc. |
| ||
Try this framework, it's what I always use : if locks the logic at 60fps and tries to maintain a 60fps render speed, so even if you get rendering slowdown your logic is always at 60fps, so your game always plays the same no matter how slowly (or quickly) it's rendering. The main resolution constants are defined at the top, GFX_fullscreen allows windowed (2) or fullscreen (1) mode. It has a central TYPE called "TYPE_game" that holds all the variables, other type instances etc.., which simulates having STRICT functionality in B3D. |
| ||
Great Framework Vorderman! ;) |