Simple and Fast Multimedia Library (SFML) is a
cross-platform
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software ...
software development
library
A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
designed to provide a simple
application programming interface (API) to various multimedia components in computers. It is written in
C++
C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
with
bindings available for
Ada
Ada may refer to:
Places
Africa
* Ada Foah, a town in Ghana
* Ada (Ghana parliament constituency)
* Ada, Osun, a town in Nigeria
Asia
* Ada, Urmia, a village in West Azerbaijan Province, Iran
* Ada, Karaman, a village in Karaman Province, ...
,
C,
Crystal
A crystal or crystalline solid is a solid material whose constituents (such as atoms, molecules, or ions) are arranged in a highly ordered microscopic structure, forming a crystal lattice that extends in all directions. In addition, macro ...
,
D,
Euphoria,
Go,
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
,
Julia
Julia is usually a feminine given name. It is a Latinate feminine form of the name Julio and Julius. (For further details on etymology, see the Wiktionary entry "Julius".) The given name ''Julia'' had been in use throughout Late Antiquity (e.g ...
,
.NET,
Nim,
OCaml,
Python
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (pro ...
,
Ruby
A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
, and
Rust
Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO( ...
.
Experimental mobile ports were made available for
Android and
iOS
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also include ...
with the release of SFML 2.2.
SFML handles creating and input to
windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ser ...
, and creating and managing
OpenGL contexts. It also provides a graphics module for simple
hardware acceleration of
2D computer graphics which includes text rendering using
FreeType, an audio module that uses
OpenAL
OpenAL (Open Audio Library) is a cross-platform audio application programming interface (API). It is designed for efficient rendering of multichannel three-dimensional positional audio. Its API style and conventions deliberately resemble those ...
and a networking module for basic
Transmission Control Protocol
The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is common ...
(TCP) and
User Datagram Protocol
In computer networking, the User Datagram Protocol (UDP) is one of the core communication protocols of the Internet protocol suite used to send messages (transported as datagrams in packets) to other hosts on an Internet Protocol (IP) network ...
(UDP) communication.
SFML is
free and open-source software provided under the terms of the
zlib/png license. It is available on
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, w ...
,
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
,
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ser ...
and
FreeBSD.
The first version v1.0 was released on 9 August 2007, the latest version v2.5.1 was released on 15 Oct 2018.
Software architecture
Modules
SFML consists of various modules:
* System –
vector
Vector most often refers to:
*Euclidean vector, a quantity with a magnitude and a direction
*Vector (epidemiology), an agent that carries and transmits an infectious pathogen into another living organism
Vector may also refer to:
Mathematic ...
and
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, wh ...
string classes, portable
threading and timer facilities
* Window –
window
A window is an opening in a wall, door, roof, or vehicle that allows the exchange of light and may also allow the passage of sound and sometimes air. Modern windows are usually glazed or covered in some other transparent or translucent mat ...
and
input device
In computing, an input device is a piece of equipment used to provide data and control signals to an information processing system, such as a computer or information appliance. Examples of input devices include keyboards, mouse, scanners, cameras ...
management including support for
joysticks,
OpenGL context management
* Graphics –
hardware acceleration of 2D graphics including
sprites,
polygon
In geometry, a polygon () is a plane figure that is described by a finite number of straight line segments connected to form a closed ''polygonal chain'' (or ''polygonal circuit''). The bounded plane region, the bounding circuit, or the two to ...
s and text rendering
* Audio – hardware-accelerated
spatialised audio playback and recording
* Network – TCP and UDP
network socket
A network socket is a software structure within a network node of a computer network that serves as an endpoint for sending and receiving data across the network. The structure and properties of a socket are defined by an application programmin ...
s, data encapsulation facilities,
HTTP
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide We ...
and
FTP
The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architecture using separate control and data ...
classes
While the graphics module is one of the main features of SFML, developers who are interested in only creating an environment to program directly in OpenGL can do so by using the Window module on its own without the graphics module. Similarly, the other modules can also be used independently of each other, except for the System module which is used by all of the modules.
Language bindings
SFML is written in C++ and provides a C++ interface (it also provides a C interface through the official CSFML binding). Several
language binding
In programming and software design, binding is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service (one that is not native to th ...
s exist that enable using SFML in other programming languages.
This table lists supported bindings for SFML .
1 Official bindings
Unofficial add-ons
SFML provides the basic functions on which
higher-level software can be built. Add-on libraries exist that provide added support for
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inst ...
s (GUIs),
2D
lighting
Lighting or illumination is the deliberate use of light to achieve practical or aesthetic effects. Lighting includes the use of both artificial light sources like lamps and light fixtures, as well as natural illumination by capturing daylig ...
,
particle system
A particle system is a technique in game physics, motion graphics, and computer graphics that uses many minute sprites, 3D models, or other graphic objects to simulate certain kinds of "fuzzy" phenomena, which are otherwise very hard to repr ...
s and
animation,
video
Video is an electronic medium for the recording, copying, playback, broadcasting, and display of moving visual media. Video was first developed for mechanical television systems, which were quickly replaced by cathode-ray tube (CRT) syst ...
playback
and
tilemaps.
Reception and adoption
SFML is primarily used by hobbyist game developers, small
independent video game developer
An indie game, short for independent video game, is a video game typically created by individuals or smaller development teams without the financial and technical support of a large game publisher, in contrast to most "AAA" (triple-A) games. ...
s, and
startup companies
A startup or start-up is a company or project undertaken by an entrepreneur to seek, develop, and validate a scalable business model. While entrepreneurship refers to all new businesses, including self-employment and businesses that never intend t ...
consisting of several developers at most. Because SFML does not require writing large amounts of code, it has been adopted by many
Ludum Dare
Ludum Dare (LD; , meaning 'to give a game', also referenced as LDJAM) is a game jam competition. It was founded by Geoff Howland and was first held in April 2002. It is currently run by Mike Kasprzak, who has been part of the team since the be ...
participants also.
Compared to older libraries such as
Simple DirectMedia Layer
Simple DirectMedia Layer (SDL) is a cross-platform
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in sever ...
(SDL) and
Allegro, the SFML user base is relatively small but growing. , its
GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continu ...
software repository
A software repository, or repo for short, is a storage location for software packages. Often a table of contents is also stored, along with metadata. A software repository is typically managed by source control or repository managers. Package ...
has been starred by 6549 users.
SFML has been used in teaching at universities and in scientific projects.
Video game use examples
* ''
Atom Zombie Smasher'',
real-time strategy
Real-time strategy (RTS) is a subgenre of strategy video games that do not progress incrementally in turns, but allow all players to play simultaneously, in "real time". By contrast, in turn-based strategy (TBS) games, players take turns to p ...
game.
*
Away Team',
Simulation
A simulation is the imitation of the operation of a real-world process or system over time. Simulations require the use of models; the model represents the key characteristics or behaviors of the selected system or process, whereas the s ...
Interactive Fiction game.
*
Chesster',
[FML Puzzle Game2011-10-18">] puzzle game.
*
Cosmoscroll',
free open-source space-based
shoot 'em up
Shoot 'em ups (also known as shmups or STGs
) are a sub-genre of action games. There is no consensus as to which design elements compose a shoot 'em up; some restrict the definition to games featuring spacecraft and certain types of charac ...
game.
*
Crea',
moddable 2D
sandbox game.
*
Enchanted Forest'
* ''
Extreme Tux Racer'',
free open-source arctic racing game featuring
Tux (using SFML since version 0.7).
*
HolySpirit',
3D
isometric hack and slash game.
*
Hope',
point and click adventure game (like
Myst
''Myst'' is a graphic adventure/puzzle video game designed by the Miller brothers, Robyn and Rand. It was developed by Cyan, Inc., published by Broderbund, and initially released for the Macintosh in 1993. In the game, the player's charact ...
).
*
I Can Transform',
2D platform game for Android.
*
KeeperRL',
dungeon simulator with rogue-like and RPG elements.
*
Kroniax',
minimalistic side-scroller, and the first SFML game for Android.
*
Limit Theory',
infinite,
procedural space game.
*
M.A.R.S.',
multiplayer shoot 'em up game.
*
Moonman',
pixel art exploration sandbox game.
*
',
free open-source
Super Hexagon clone.
*
Ovid The Owl',
puzzle
platform game
A platform game (often simplified as platformer and sometimes called a jump 'n' run game) is a sub-genre of action video games in which the core objective is to move the player character between points in an environment. Platform games are charac ...
.
*
Pioneers',
turn based
In video and other games, the passage of time must be handled in a way that players find fair and easy to understand. This is usually done in one of the two ways: real-time and turn-based.
Real-time
Real-time games have game time progress cont ...
exploration game with some RPG elements.
*
Postmortem: one must die',
narrative
adventure game.
*
Project Black Sun',
retro 2D
side-scrolling video game
''
A side-scrolling video game (alternatively side-scroller), is a game viewed from a side-view camera angle where the screen follows the player as they move left or right. The jump from single-screen or flip-screen graphics to scrolling graphic ...
.
TacWars a puzzle RPG that pits Dwarves against Goblins.
*
The Duke',
action platform game.
*
The Shooting of Isaac',
vertical shooter game.
*
Vagante',
action
RPG platform game.
*
Zloxx',
2D action platformer.
Further examples of games using SFML are listed on
IndieDB.
sfml/games
/ref>
Other software use
*
Aquila
', open source digital signal processing (DSP) library for C++.
*
Otter
', a 2D C# framework built on SFML 2.
* '' GDevelop'', open source game creation software.
*
Immersion Engine
', tool to visualize detailed landscapes and architecture.
*
is::Engine
', 2D C++ game engine for Android and PC.
See also
* Allegro
* ClanLib
* Cross-platform support middleware
* GLFW
GLFW (Graphics Library Framework) is a lightweight utility library for use with OpenGL. It provides programmers with the ability to create and manage windows and OpenGL contexts, as well as handle joystick, keyboard and mouse input.
Softwar ...
* OpenGL
* OpenGL Utility Toolkit
The OpenGL Utility Toolkit (GLUT) is a library of utilities for OpenGL programs, which primarily perform system-level I/O with the host operating system. Functions performed include window definition, window control, and monitoring of keyboard ...
(GLUT)
* Raylib
* Simple DirectMedia Layer
Simple DirectMedia Layer (SDL) is a cross-platform
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in sever ...
(SDL)
References
Further reading
* Jan Haller, Henrik Vogelius Hansson, Artur Moreira: ''SFML Game Development'', Packt Publishing,
* http://www.lifehacker.com.au/2013/02/xna-is-dead-3-alternatives-that-let-you-use-your-c-and-net-skills/
* https://www.binpress.com/tutorial/creating-a-city-building-game-with-sfml/137
* http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition-The-Introduction.aspx
External links
*
*
SFML Tutorials
{{Widget toolkits
Application programming interfaces
Audio libraries
C++ libraries
Cross-platform software
Free software
Graphics libraries
Linux APIs
MacOS APIs
Software using the zlib license
Video game development
Video game development software for Linux
Windows APIs