Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

PSFML

PSFML - Simple Fast Multimedia Library for Pascal

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

SFML

PSFML

Simple and Fast Multimedia Library for Pascal

Pascal bindings that allow you to use SFML and other useful libraries with Delphi and FreePascal.

Included

Additional Features

  • ZipFile - Added support for loading/streaming SFML resources from a standard zip archive.

Minimum Requirements

  • Should work on Windows 7+ (64 bits)
  • Should work on any Delphi/FreePascal that can target Win64/Unicode

NOTE: Made/tested on Windows/Delphi 11.

Usage

You simply add PSFML to your uses section and everything will be linked in your executable, ready for use with no DLLs to maintain. You will have direct access to all the aforementioned libraries.

pascal
uses
  SysUtils,
  PSFML;

var
  LMode: sfVideoMode;
  LRenderWindow: PsfRenderWindow;
  LEvent: sfEvent;
begin
  LMode.Width := 800;
  LMode.Height := 600;
  LMode.BitsPerPixel := 32;

  LRenderWindow := sfRenderWindow_create(LMode, 'SFML Window', sfResize or sfClose, nil);
  SetDefaultIcon(LRenderWindow);

  while sfRenderWindow_isOpen(LRenderWindow) = sfTrue do
  begin
    while sfRenderWindow_pollEvent(LRenderWindow, @LEvent) = sfTrue do
    begin
      if LEvent.type_ = sfEvtClosed then
        sfRenderWindow_close(LRenderWindow);
    end;

    sfRenderWindow_clear(LRenderWindow, DARKSLATEBROWN);
    sfRenderWindow_display(LRenderWindow);
  end;

  sfRenderWindow_destroy(LRenderWindow);
end.

Support