program HowToDrawFramesPerSecond; uses SwinGame,sgTypes; procedure Main(); begin OpenGraphicsWindow('Draw Framerate' ,400 ,300 ); repeat ProcessEvents(); ClearScreen(ColorWhite ); DrawFramerate(10 ,8 ); RefreshScreen(); until WindowCloseRequested(); ReleaseAllResources(); end; begin Main(); end.
How To Draw Frames Per Second
This beginner level how to draws the frame rate to the screen. Seeing this output gives you an understanding the game loop.
Displaying the framerate in your game window can be useful for debugging or general game loop information. To DrawFramerate simply pass in the X and Y location of where you want the text to be displayed in the game window.
The Text API shows other methods for drawing the framerate to the screen.