Jump to content

Recommended Posts

sfml-logo.png.3f4db917d48681a2b712a5a2ca93349a.png

 

SFML
Simple Fast Multimedia Layer
Bindings that allow you to use SFML and other useful C libraries with Pascal.

 

Included

 

Minimum Requirements

 

Usage

  • Add SFML to your uses section to access all the aforementioned libraries.
  • You link to SFML dynamically by default and will look for the SFML DLL in your application path. You can also call InitSFML, before any other routine, with a the path to the DLL location.
  • Define SFML_STATIC in SFML.pas to statically link to SFML and the DLL will not have to be included in your application distro. InitSFML will have no effect and you can leave it in your sources so that you can switch between static and dynamic linking during development.
uses
  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.kind = 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

 

Edited by tinyBigGAMES
  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×