GithubHelp home page GithubHelp logo

stahta01 / asfml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mgrojo/asfml

0.0 1.0 0.0 10.65 MB

Ada binding to the SFML library

License: Other

Shell 0.24% Python 0.31% Ada 98.42% Awk 0.47% CSS 0.48% Makefile 0.07%

asfml's Introduction

ASFML logo Ada (GNAT) Alire Gitter chat Mentioned in Awesome Ada

ASFML โ€” Ada's Simple and Fast Multimedia Library

ASFML is an Ada semi-thick binding to the SFML library. It uses Ada types and portable defined types which eliminates the inclusion of Ada interface libraries, but most of the functions are directly imported.

It is written in standard Ada without the use of any specific GNAT extensions, but some indirect dependency could exist through the representation of some types.

State

The binding is considered complete. Three versions of CSFML have been bound: 1.6, 2.4 and 2.5 (see Releases). The API is considered stable, changes would only be made to fix errors or to upgrade to a new SFML version.

The library has been tested with several GNAT versions and on Windows 10 and Ubuntu Linux 20.04 LTS and 22.04.

API Documentation

Generated API documentation can be consulted online.

The Ada API follows the CSFML interface, but with some changes and additions to ease the use:

  • Prefixes in C are converted to simple names inside hierarchical packages. For example, the function sfMusic_createFromFile in SFML/Audio/Music.h is transformed into the createFromFile function in the Sf.Audio.Music package.
  • Basic data types from SFML/Config.h are defined in the Sf package.
  • General types at SFML/Module/Types.h are moved to the package Sf.Module, where Module is Audio, System, Graphics, Window and Network.
  • Defaults are applied to parameters when useful and to approximate the C++ API.
  • Functions with char* parameters are wrapped to do the conversion to standard Ada String parameters.
  • Unicode is supported using Wide_Wide_String in Ada where the C API uses sfUint32*

How to build with Alire

This library is available in Alire so building is as easy as installing Alire and then executing: alr build asfml

How to build without Alire

Install CSFML following instructions of your platform. For example, under Ubuntu or Debian: sudo apt-get install gnat gprbuild libcsfml-dev libglu1-mesa-dev

Open a terminal and run this command: gprbuild asfml.gpr

How to use

To compile your program you need to "with" the asfml.gpr project. Then you can build using gprbuild.

Use asfml_opengl.gpr if you are using OpenGL.

Under Windows, you might need to update the path to your libraries in the provided GPR files.

Using Alire, you can add this library to your project as simply as: alr with asfml

Examples

You can see simple test examples in the tests directory. For some demo games, you can review the project 16-Games.

Links to projects using ASFML can be found in the Wiki.

asfml's People

Contributors

fabien-chouteau avatar mgrojo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.