Sign in Join

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

Catalog · How the catalog works

Random project

SFML

Delphi headers for SFML

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

SFML

Simple Fast Multimedia Layer

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

Included

Minimum Requirements

Usage

You simply add SFML 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
  System.SysUtils,
  SFML;

var
  Mode: sfVideoMode;
  Window: PsfRenderWindow;
  Event: sfEvent;
  Music: PsfMusic;
  
begin
  Mode.Width := 800;
  Mode.Height := 600;
  Mode.BitsPerPixel := 32;
  
  Window := sfRenderWindow_create(Mode, 'Hello SFML', sfResize or sfClose, nil);

  Music := sfMusic_createFromFile('arc/audio/music/song01.ogg');
  sfMusic_play(Music);

  while sfRenderWindow_isOpen(Window) = sfTrue do
  begin
    while sfRenderWindow_pollEvent(Window, @Event) = sfTrue do
    begin
      if Event._type = sfEvtClosed then
        sfRenderWindow_close(Window);
    end;

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

  sfMusic_stop(Music);
  sfMusic_destroy(Music);
  sfRenderWindow_destroy(Window);
end.

Support

Delphi

Made with :heart: in Delphi