Jump to content

Simple and Fast Multimedia Library

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 82.136.210.153 (talk) at 12:19, 9 August 2014 (Reception and adoption: Adding external links to make the overview more useful.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Original author(s)Laurent Gomila, and others
Stable release
2.1 / July 27, 2013; 11 years ago (2013-07-27)
Repository
Written inC++
Operating systemLinux, OS X, Windows, et al.
TypeAPI library
Licensezlib License[1][2]
Websitewww.sfml-dev.org

Simple and Fast Multimedia Library (SFML) a portable API for multimedia programming. It is written in C++ with bindings available for C, D, Python, Ruby, OCaml, .Net and Go.

SFML provides hardware accelerated 2D graphics using OpenGL, supports OpenGL windowing and provides different modules that ease multimedia and game programming. SFML site offers complete SDK bundle in single pack, and tutorials to ease the developers. SFML Source code is provided under the terms of the zlib/png license.

SFML is available on Linux and other platforms.

Software architecture

Modules

The modules currently available are:

  • The System module manages the clock and threads.
  • The Window module manages windows and user interactions.
  • The Graphics module makes it easy to display simple shapes and images.
  • The Audio module provides an interface to handle sounds and music.
  • The Network module handles sockets in a portable way.

All the modules can be used independently, except the Graphics module that depends on the Window module, and all the modules that depend on the System module.

Programming language bindings

A library written in one programming language may be used in another language if bindings are written; The library's primarily supported language is C++, however there are bindings for SFML in other programming languages.[3]

Official language bindings

External language bindings

Hello World

The program below provides a short overview of the SFML. This code just opens a window and fills it with blue:

#include <SFML/Graphics.hpp>

int main()
{
    // Create the main window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Hello World - SFML");

    // Start the main loop
    while (App.isOpen())
    {
        // Process events
        sf::Event Event;
        while (App.pollEvent(Event))
        {
            // Close window : exit
            if (Event.type == sf::Event::Closed)
                App.close();
        }
        // Clear screen, and fill it with blue
        App.clear(sf::Color::Blue);

        // Display the content of the window on screen
        App.display();
    }
    return 0;
}


Reception and adoption

Reception

Adoption

SFML has been adopted by several games.

History

  • 1.0 (July 2007)
    • 1.1 (18 September 2007)
    • 1.2 (16 January 2008)
    • 1.3 (22 June 2008)
    • 1.4 (7 January 2009)
    • 1.5 (4 June 2009)
    • 1.6 (6 April 2010) : Mainly a bug-fix release
  • 2.0 (29 April 2013)
    • 2.1 (27 July 2013)

Further reading

  • Jan Haller, Henrik Vogelius Hansson, Artur Moreira: SFML Game Development, Packt Publishing, ISBN 1-849696-84-5

See also

References

  1. ^ "License".
  2. ^ https://github.com/LaurentGomila/SFML/blob/master/license.txt
  3. ^ "Programming language bindings".

Template:Open-source video games