Downloading PasSFML and Learning from Examples

This page should help you to get started with PasSFML in Lazarus on Windows.

  1. Click on the Download ZIP button on this GitHub PasSFML page.
  2. Extract all of the contents of the zip folder to a convenient location.
  3. 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.
  4. 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;
    • audio;
    • handling keyboard input and window closed events;
    • using a timer (TSfmlClock).
  5. 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.
  6. 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.
Programming - a skill for life!

How to use the Simple Fast Media Library in Lazarus