{"id":20258408,"url":"https://github.com/tinybiggames/psfml","last_synced_at":"2025-04-11T01:02:09.402Z","repository":{"id":262681651,"uuid":"860691662","full_name":"tinyBigGAMES/PSFML","owner":"tinyBigGAMES","description":"SFML for Pascal","archived":false,"fork":false,"pushed_at":"2025-01-09T21:00:11.000Z","size":154957,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T16:13:30.216Z","etag":null,"topics":["delphi","fpc","game-library","opengl","pascal","sfml","shaders","win64","windows-10","windows-11"],"latest_commit_sha":null,"homepage":"","language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinyBigGAMES.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"tinyBigGAMES","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-09-21T00:06:27.000Z","updated_at":"2025-01-27T12:41:22.000Z","dependencies_parsed_at":"2024-11-13T18:40:42.888Z","dependency_job_id":"2bedf217-eaf5-40b0-878e-fcaf0ada00fd","html_url":"https://github.com/tinyBigGAMES/PSFML","commit_stats":null,"previous_names":["tinybiggames/psfml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyBigGAMES%2FPSFML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyBigGAMES%2FPSFML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyBigGAMES%2FPSFML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyBigGAMES%2FPSFML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinyBigGAMES","download_url":"https://codeload.github.com/tinyBigGAMES/PSFML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322599,"owners_count":21084336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delphi","fpc","game-library","opengl","pascal","sfml","shaders","win64","windows-10","windows-11"],"created_at":"2024-11-14T11:08:51.216Z","updated_at":"2025-04-11T01:02:09.380Z","avatar_url":"https://github.com/tinyBigGAMES.png","language":"Pascal","funding_links":["https://github.com/sponsors/tinyBigGAMES"],"categories":[],"sub_categories":[],"readme":"![PSFML](media/psfml-logo.png)  \n\n[![Chat on Discord](https://img.shields.io/discord/754884471324672040?style=for-the-badge)](https://discord.gg/tPWjMwK)\n[![Follow on Bluesky](https://img.shields.io/badge/Bluesky-tinyBigGAMES-blue?style=for-the-badge\u0026logo=bluesky)](https://bsky.app/profile/tinybiggames.com)\n\n**PSFML** is a Pascal binding for the **⚡ Simple and Fast Multimedia Library (SFML)**, providing Pascal developers with a straightforward way to utilize SFML’s multimedia features directly in their projects. Whether building 🎮 games, 🤖 interactive applications, or 🎥 multimedia tools, PSFML integrates smoothly with SFML, bringing robust multimedia functionality to the Pascal ecosystem.\n\n## 📋 Table of Contents\n- [📖 Introduction](#introduction)\n- [✨ Features](#features)\n- [🚀 Getting Started](#getting-started)\n  - [📌 Requirements](#requirements)\n  - [⚙️ Installation](#installation)\n- [📐 Usage](#usage)\n  - [💡 Basic Example](#basic-example)\n- [🛠️ Extensions](#extensions)\n  - [🗜️ ZipFile Support](#zipfile-support)\n  - [📼 MPEG-1 Video Playback](#mpeg-1-video-playback)\n  - [📄 Enhanced InputStream](#enhanced-inputstream)\n- [🤝 Contributing](#contributing)\n- [📄 License](#license)\n- [🆘 Support](#support)\n\n## Introduction\n\nPSFML leverages the power of **SFML** and makes it accessible to Pascal programmers. With PSFML, you can create 🪟 windowed applications, manage 🖼️ graphics, handle real-time user input 🎮, play 🔊 audio, and even stream 📹 video. PSFML is built specifically to work on **💻 Windows** (Windows 10 and higher) and is fully compatible with [Delphi](https://www.embarcadero.com/products/delphi).\n\n### Why PSFML?\n\n- **📝 Pascal-Focused**: PSFML is designed explicitly for Pascal developers, offering a familiar and intuitive API that fits naturally into existing Pascal workflows.\n- **📦 Minimal Distribution Overhead**: All library dependencies are embedded within the executable, ensuring a streamlined deployment process that eliminates external dependencies and minimizes potential compatibility issues.\n- **🛠️ Modern Compiler Support**: PSFML is compatible with **Delphi Community Edition** and higher, enabling seamless integration for Delphi developers targeting **Windows 64-bit**. PSFML has been rigorously tested on **Windows 11 24H2**, ensuring stability and performance for professional-grade applications. \n- **🆕 Up-to-Date with SFML**: Always kept in sync with the latest **SFML** version, ensuring access to all the latest features and fixes.\n\n## Features\n\n- **🔑 Core SFML Integration**: Full access to SFML’s core features for Pascal developers, including 🪟 window management, 🖼️ rendering, 🎮 input handling, 🔊 audio playback, and 🌐 network communication.\n- **🛠️ Extension Support**: Includes several valuable extensions that add capabilities beyond the base SFML functionality.\n  - **🗜️ ZipFile Support**: Standard compression and encryption to manage archived resources like assets or save data seamlessly.\n  - **📼 MPEG-1 Video Playback**: Support for video playback, useful for creating 🎮 game cutscenes or multimedia features.\n  - **📄 Enhanced InputStream**: Built to work with **ZipFile** and other input sources, providing flexible options for handling data streams.\n  - **📏 High-DPI Awareness**: Automatically adjusts the rendering window size based on the desktop DPI value to maintain consistent visual quality on different displays.\n  - **🔮 Future Extensions**: Additional features will be added in future updates, enhancing the library's utility.\n- **⚡ Optimized for Windows**: Developed with a focus on **Windows 11** using **Delphi 12.2** to provide a stable, performant foundation for 🎮 game and multimedia applications.\n\n## Getting Started\n\n### Requirements\n\n- **Delphi CE** or a higher edition for development.\n- **💻 Windows 10** or higher (64-bit).\n\n### Installation\n\n1. 📥 Download the latest version of [PSFML](https://github.com/tinyBigGAMES/PSFML/archive/refs/heads/main.zip).\n2. 📂 Extract the contents to your project directory.\n3. ➕ Add the **PSFML** `src` folder to your **Library Path** in Delphi.\n4. 📝 In your project, include `PSFML` in the `uses` clause. To leverage the extensions, add `PSFML.Ext` after `PSFML` in the `uses` clause.\n5. 📁 Refer to the `examples` folder for detailed usage instructions and demonstrations of the PSFML library in action.\n6. ▶️ It is recommended to run the `ZipFile01` example initially to generate the `data.zip` file required by other examples.\n\n## Usage\n\n### Basic Example\n\nBelow is a simple example of how to create a 🪟 window and handle real-time user input 🎮 using **PSFML**:\n\n```pascal\nuses\n  System.SysUtils,\n  PSFML,     // core SFML\n  PSFML.Ext; // extensions; must always come AFTER PSFML\n\nvar\n  LWindow: PsfRenderWindow;\n  LEvent: sfEvent;\n  LFont: array[0..0] of PsfFont;\n  LText: array[0..0] of PsfText;\n  LHudPos: sfVector2f;\nbegin\n  LWindow := sfRenderWindow_create('PSFML: RenderWindow #01');\n\n  LFont[0] := sfFont_CreateDefaultFont();\n  sfFont_SetSmooth(LFont[0], True);\n\n  LText[0] := sfText_Create(LFont[0]);\n  sfText_SetCharacterSize(LWindow, LText[0], 12);\n\n  sfRenderWindow_clear(LWindow, BLACK);\n  sfRenderWindow_clearFrame(LWindow, DARKSLATEBROWN);\n\n  while sfRenderWindow_isOpen(LWindow) do\n  begin\n    while sfRenderWindow_pollEvent(LWindow, @LEvent) do\n    begin\n      case LEvent.\u0026type of\n        sfEvtClosed:\n          sfRenderWindow_close(LWindow);\n\n        sfEvtResized:\n          sfRenderWindow_resizeFrame(LWindow, LEvent.size.width, LEvent.size.height);\n\n        sfEvtKeyReleased:\n          if LEvent.key.code = sfKeyEscape then\n            sfRenderWindow_close(LWindow);\n      end;\n    end;\n\n    sfRenderWindow_startFrame(LWindow);\n\n    sfRenderWindow_drawFilledRect(LWindow, LWindow.Size.x - 50, 0, 50, 50, RED);\n\n    LHudPos := sfVector2f_Create(3, 3);\n    sfRenderWindow_DrawTextVarY(LWindow, LText[0], LHudPos.x, LHudPos.y, WHITE,\n      '%d fps', [sfRenderWindow_GetFrameRate(LWindow)]);\n    sfRenderWindow_DrawTextVarY(LWindow, LText[0], LHudPos.x, LHudPos.y, DARKGREEN,\n      'ESC - Quit', []);\n\n    sfRenderWindow_endFrame(LWindow);\n    sfRenderWindow_display(LWindow);\n  end;\n\n  sfText_Destroy(LText[0]);\n  sfFont_Destroy(LFont[0]);\n  sfRenderWindow_destroy(LWindow);\nend.\n```\n\nThis example demonstrates basic 🪟 window creation, event polling, and drawing 📝 text, providing a starting point for any real-time application.\n\n## Extensions\n\n### ZipFile Support\n\nPSFML includes integrated support for working with compressed and encrypted zip files using **ZipFile**. This extension allows you to load resources like 🖼️ textures, 🔊 sounds, and other data directly from a zip archive.\n\n### MPEG-1 Video Playback\n\nThe video playback extension allows for **MPEG-1** video file streaming, ideal for in-game cutscenes or multimedia presentations.\n\n### Enhanced InputStream\n\nThe **Enhanced InputStream** offers improved capabilities for streaming files, especially when used in conjunction with **ZipFile**, making it easier to work with archived content.\n\n## Contributing\n\nContributions to **PSFML** are highly encouraged. If you'd like to contribute to the project, please submit issues or pull requests on our [GitHub repository](https://github.com/tinyBigGAMES/PSFML).\n\n\u003ca href=\"https://github.com/tinyBigGAMES/PSFML/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=tinyBigGAMES/PSFML\u0026max=500\u0026columns=20\u0026anon=1\" /\u003e\n\u003c/a\u003e\n\n## License\n\n**PSFML** is distributed under the **BSD-3-Clause License**, allowing for redistribution and use in both source and binary forms, with or without modification, under specific conditions. See the [LICENSE](https://github.com/tinyBigGAMES/PSFML?tab=BSD-3-Clause-1-ov-file#BSD-3-Clause-1-ov-file) file for more details.\n\n## Support\n\n- [🐛 Issues](https://github.com/tinyBigGAMES/PSFML/issues)\n- [💬 Discussions](https://github.com/tinyBigGAMES/PSFML/discussions)\n- [🌐 SFML Website](https://www.sfml-dev.org/)\n- [📺 SFML on YouTube](https://www.youtube.com/results?search_query=SFML\u0026sp=CAI%253D)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"media/delphi.png\" alt=\"Delphi\"\u003e\n\u003c/p\u003e\n\u003ch5 align=\"center\"\u003eMade with ❤️ in Delphi\u003c/h5\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybiggames%2Fpsfml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinybiggames%2Fpsfml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybiggames%2Fpsfml/lists"}