Chris Thrasher 3f4bb1ae12 Prevent constructing sf::Text with a temporary sf::Font
By deleting this constructor overload, it fails to compile if
you pass a temporary font to this parameter slot. That includes
code like

  sf::Text text("", sf::Font());

but more importantly it prohibits code like this

  sf::Font getFont()
  {
    sf::Font font;
    // load a font...
    return font;
  }

  sf::Text text("", getFont());

The same idea can be applied to setFont() to prevent setting fonts
from a temporary.

Credit to Jonny for the idea

Co-authored-by: JonnyPtn <jonathan.r.paton@googlemail.com>
2023-01-06 10:21:00 -07:00
2022-12-14 15:26:08 -07:00
2022-12-12 16:10:03 -07:00
2022-12-27 17:58:49 -06:00
2023-01-04 09:49:20 -07:00
2022-12-12 16:10:03 -07:00
2015-02-06 11:07:39 +01:00
2022-09-28 07:30:21 +02:00

SFML logo

SFML — Simple and Fast Multimedia Library

SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing, graphics, audio and network. It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python.

State of Development

SFML is currently in an interesting state of development, which can quickly become confusing if you aren't following it closely. As such we want to clarify where to get which version.

  • The master branch contains work in progress for the next major version SFML 3. As such it's considered unstable, but any testing and feedback is highly appreciated.
  • The 2.6.x branch is the nearly complete next minor version SFML 2.6, which should be very stable, even if it hasn't been officially released yet.
  • The 2.5.1 tag is the last official SFML release, but it lacks a lot of fixes and features that can already be found on the 2.6.x branch.

Download

  • You can get the latest official release on SFML's website.
  • You can also get the source code of the current development version from the Git repository.
  • Alternatively, you can get the latest snapshot / artifact builds from the artifacts storage.

Install

Follow the instructions of the tutorials, there is one for each platform/compiler that SFML supports.

Learn

There are several places to learn SFML:

Community

Here are some useful community links:

Contribute

SFML is an open-source project, and it needs your help to go on growing and improving. If you want to get involved and suggest some additional features, file a bug report or submit a patch, please have a look at the contribution guidelines.

Authors

License

The SFML libraries and source code are distributed under the zlib/libpng license. See license.md. External libraries used by SFML are distributed under their own licenses.

In short, SFML is free for any use (commercial or personal, proprietary or open-source). You can use SFML in your project without any restriction. You can even omit to mention that you use SFML -- although it would be appreciated.

External libraries used by SFML

Description
SFML playground
Readme 98 MiB
Languages
C++ 87.3%
Objective-C++ 7%
CMake 3.4%
Objective-C 1.9%
Shell 0.2%
Other 0.1%