HOME

TheInfoList



OR:

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 vi ...
designed to provide a simple application programming interface (API) to various multimedia components in computers. It is written in C++ with bindings available for Ada, 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, macr ...
, D,
Euphoria Euphoria ( ) is the experience (or affect) of pleasure or excitement and intense feelings of well-being and happiness. Certain natural rewards and social activities, such as aerobic exercise, laughter, listening to or making music and dan ...
, 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 mo ...
,
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 ...
, .NET,
Nim Nim is a mathematical two player game. Nim or NIM may also refer to: * Nim (programming language) * Nim Chimpsky, a signing chimpanzee Acronyms * Network Installation Manager, an IBM framework * Nuclear Instrumentation Module * Negative index met ...
,
OCaml OCaml ( , formerly Objective Caml) is a general-purpose, multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, D ...
, Python,
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 sapp ...
, 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(OH), ...
. Experimental mobile ports were made available for
Android Android may refer to: Science and technology * Android (robot), a humanoid robot or synthetic organism designed to imitate a human * Android (operating system), Google's mobile operating system ** Bugdroid, a Google mascot sometimes referred to ...
and iOS 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 ...
, and creating and managing
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve ha ...
contexts. It also provides a graphics module for simple
hardware acceleration Hardware acceleration is the use of computer hardware designed to perform specific functions more efficiently when compared to software running on a general-purpose central processing unit (CPU). Any transformation of data that can be calc ...
of
2D computer graphics 2D computer graphics is the computer-based generation of digital images—mostly from two-dimensional models (such as 2D geometric models, text, and digital images) and by techniques specific to them. It may refer to the branch of computer ...
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) networ ...
(UDP) communication. SFML is
free and open-source software Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
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, which i ...
,
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 (computer), Mac computers. Within the market of ...
,
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 ...
and
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
. 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, ...
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
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 mate ...
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
joystick A joystick, sometimes called a flight stick, is an input device consisting of a stick that pivots on a base and reports its angle or direction to the device it is controlling. A joystick, also known as the control column, is the principal cont ...
s,
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve ha ...
context management * Graphics –
hardware acceleration Hardware acceleration is the use of computer hardware designed to perform specific functions more efficiently when compared to software running on a general-purpose central processing unit (CPU). Any transformation of data that can be calc ...
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 t ...
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 Web, ...
and FTP 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 ...
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 User (computing), users to Human–computer interaction, interact with electronic devices through graphical icon (comp ...
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 dayli ...
,
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 rep ...
s and animation,
video Video is an Electronics, electronic medium for the recording, copying, playback, broadcasting, and display of moving picture, moving image, visual Media (communication), media. Video was first developed for mechanical television systems, whi ...
playback and tilemaps.


Reception and adoption

SFML is primarily used by hobbyist game developers, small independent video game developers, and
startup companies A startup or start-up is a company or project undertaken by an Entrepreneurship, entrepreneur to seek, develop, and validate a scalable business model. While entrepreneurship refers to all new businesses, including self-employment and businesses 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 participants also. Compared to older libraries such as
Simple DirectMedia Layer Simple DirectMedia Layer (SDL) is a cross-platform software development library designed to provide a hardware abstraction layer for computer multimedia hardware components. Software developers can use it to write high-performance computer game ...
(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, co ...
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 ''Atom Zombie Smasher'' is a real-time strategy game developed by independent developer Blendo Games. In it, the player attempts to rescue as many citizens as possible from an oncoming zombie horde using helicopter rescue units and an array of m ...
'',
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 pla ...
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 ...
Interactive Fiction '' Interactive fiction, often abbreviated IF, is software simulating environments in which players use text commands to control characters and influence the environment. Works in this form can be understood as literary narratives, either in the ...
game. *
Chesster
',FML Puzzle Game2011-10-18">
puzzle A puzzle is a game, problem, or toy that tests a person's ingenuity or knowledge. In a puzzle, the solver is expected to put pieces together ( or take them apart) in a logical way, in order to arrive at the correct or fun solution of the 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 chara ...
game. *
Crea
', moddable 2D sandbox game. *
Enchanted Forest
' * ''
Extreme Tux Racer ''Tux Racer'' is a 2000 open-source winter sports racing video game starring the Linux mascot, Tux the penguin. It was originally developed by Jasmin Patry as a computer graphics project at the University of Waterloo. Later on, Patry and the ...
'', free open-source arctic racing game featuring Tux (using SFML since version 0.7). *
HolySpirit
', 3D
isometric The term ''isometric'' comes from the Greek for "having equal measurement". isometric may mean: * Cubic crystal system, also called isometric crystal system * Isometre, a rhythmic technique in music. * "Isometric (Intro)", a song by Madeon from ...
hack and slash Hack and slash, also known as hack and slay (H&S or HnS) or slash 'em up, refers to a type of gameplay that emphasizes combat with melee-based weapons (such as swords or blades). They may also feature projectile-based weapons as well (such a ...
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 characte ...
). *
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 Procedural may refer to: * Procedural generation, a term used in computer graphics applications *Procedural knowledge, the knowledge exercised in the performance of some task * Procedural law, a legal concept *Procedural memory, a cognitive scienc ...
space game. *
M.A.R.S.
', multiplayer shoot 'em up game. *
Moonman
', pixel art exploration sandbox game. *

', free open-source
Super Hexagon ''Super Hexagon'' is an indie rhythm video game developed by Terry Cavanagh, with music composed by Chipzel. Originally released for iOS in September 2012, versions for Windows and macOS were released 3 months later, and Android, BlackBerry an ...
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 game, action video games in which the core objective is to move the player character between points in an environment. Platform game ...
. *
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 An adventure game is a video game genre in which the player assumes the role of a protagonist in an interactive story driven by exploration and/or puzzle-solving. The genre's focus on story allows it to draw heavily from other narrative-based m ...
. *
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 graphi ...
.
TacWars
a puzzle RPG that pits Dwarves against Goblins. *
The Duke
', action platform game. *
The Shooting of Isaac
', vertical shooter game. *
Vagante
', action
RPG RPG may refer to: Military * Rocket-propelled grenade, a shoulder-launched anti-tank weapon **''Ruchnoi Protivotankoviy Granatomyot'' (Russian: ''Ручной Противотанковый Гранатомёт''), hand-held anti-tank grenade laun ...
platform game. *
Zloxx
', 2D action platformer. Further examples of games using SFML are listed on
IndieDB Mod DB is a website that focuses on general video game modding. It was founded in 2002 by Scott "INtense!" Reismanis. As of September 2015, the Mod DB site has received over 604 million views, has more than 12,500 modifications registered, and ...
.sfml/games
/ref>


Other software use

*
Aquila
', open source
digital signal processing Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner ar ...
(DSP) library for C++. *
Otter
', a 2D C# framework built on SFML 2. * ''
GDevelop GDevelop is a 2D cross-platform, free and open-source game engine, which mainly focuses on creating PC and Mobile games, as well as HTML5 games playable in the browser. Created by Florian Rival; a software engineer at Google, GDevelop is mainly a ...
'', 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 ClanLib is a video game SDK, supporting Microsoft Windows, macOS, and Linux, with partial support for mobile platforms. It has full hardware accelerated graphics support through OpenGL, and also a software renderer. ClanLib also helps in playing ...
* Cross-platform support middleware * GLFW *
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve ha ...
* OpenGL Utility Toolkit (GLUT) *
Raylib raylib (officially named all lowercase) is a cross-platform open-source software development library. The library was made to create graphical applications and games. The library was inspired by the Borland BGI graphics library and by the X ...
*
Simple DirectMedia Layer Simple DirectMedia Layer (SDL) is a cross-platform software development library designed to provide a hardware abstraction layer for computer multimedia hardware components. Software developers can use it to write high-performance computer game ...
(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