Downloading PasSFML and Learning from Examples
This page should help you to get started with PasSFML in Lazarus on Windows.
- Click on the Download ZIP button on this GitHub PasSFML page.
- Extract all of the contents of the zip folder to a convenient location.
Open PasSFML-master\Examples\Pong\Pong.lpi with Lazarus and press F9. Use the up and down arrow keys to control the left paddle.
The example should work because the download contains the necessary dynamic link library (.dll) files in the PasSFML-master\Binaries\Win32 folder. You should now find Pong.exe in the same folder.
Look at the Pascal source code of Pong.
Pong demonstrates, among other features:
- clearing the screen;
- motion graphics by drawing a rectangle and circle in different positions after clearing the screen;
- drawing text using the Sansation.ttf true-type font file;
- handling keyboard input and window closed events;
- using a timer (TSfmlClock).
Look at other demonstrations such as Win32 (an impressive demonstration of images), Window (rotating cube), Sound and SoundCapture.
(We were able to compile the first versions of the Render and Voip examples). Render, the most impressive demonstration, was fixed on 28th May 2015.
- When you are writing your own programs, you can copy as necessary to your project folder the dynamic link libraries from PasSFML-master\Binaries\Win32 and the PasSFML source files (including Sfml.inc) from the PasSFML-master\Source folder.