Simple and Fast Multimedia Library

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Simple and Fast Multimedia Library
SFML2.svg
Original author(s) Laurent Gomila, and others
Stable release 2.1 / July 27, 2013; 13 months ago (2013-07-27)
Written in C++
Operating system Linux, OS X, Windows, et al.
Type API library
License zlib License[1][2]
Website www.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 Windows, Linux and OS X.[3]

Software architecture[edit]

Modules[edit]

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[edit]

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.[4]

Official language bindings[edit]

External language bindings[edit]

  • Python : 2.0
  • D : 1.6 (Derelict 2) and 2.0 (Derelict 3)
  • Ruby : RC-2.0
  • OCaml : 1.6 and RC-2.0
  • Java : 2.1
  • Rust : 2.1

Hello World[edit]

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[edit]

Reception[edit]

Adoption[edit]

SFML has been adopted by several games.

History[edit]

  • 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)

See also[edit]

References[edit]

  1. ^ "License". 
  2. ^ https://github.com/LaurentGomila/SFML/blob/master/license.txt
  3. ^ Gomila, Laurent. "SFML 2.1 (SFML / Download)". SFML. Retrieved 9 August 2014. 
  4. ^ "Programming language bindings". 
  5. ^ Chung, Brendon (20 August 2011). "Atom Zombie Tech « Blendo news". Blendo Games. Retrieved 9 August 2014. 

Further reading[edit]

External links[edit]