Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Delphi Bindings for SFML  (Read 87 times)

0 Members and 1 Guest are viewing this topic.

tinyBigGAMES LLC

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • tinyBigGAMES LLC
    • Email
Delphi Bindings for SFML
« on: January 12, 2022, 12:12:04 am »
Pascal bindings that allow you to use SFML and other useful C libraries with Delphi.

https://github.com/tinyBigGAMES/SFML

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

Usage

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.
 
Jarrod Davis
Owner/Lead Developer
tinyBigGAMES LLC

 

anything