Welcome
Welcome to the official SFML documentation. Here you will find a detailed view of all the SFML classes, as well as source files.
If you are looking for tutorials, you can visit the official website at www.sfml-dev.org.
Short example
Here is a short example, to show you how simple it is to use SFML :
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
int main()
{
return EXIT_FAILURE;
return EXIT_FAILURE;
return EXIT_FAILURE;
while (App.IsOpened())
{
while (App.GetEvent(Event))
{
if (Event.
Type == sf::Event::Closed)
App.Close();
}
App.Clear();
App.Draw(Sprite);
App.Draw(Text);
App.Display();
}
return EXIT_SUCCESS;
}
Event defines a system event and its parameters.
EventType Type
Type of the event.
Font is the low-level class for loading and manipulating character fonts.
bool LoadFromFile(const std::string &Filename, unsigned int CharSize=30, const Unicode::Text &Charset=ourDefaultCharset)
Load the font from a file.
Image is the low-level class for loading and manipulating images.
bool LoadFromFile(const std::string &Filename)
Load the image from a file.
Music defines a big sound played using streaming, so usually what we call a music :).
bool OpenFromFile(const std::string &Filename)
Open a music file (doesn't play it – call Play() for that).
Simple wrapper for sf::Window that allows easy 2D rendering.
void Play()
Start playing the audio stream.
Sprite defines a sprite : texture, transformations, color, and draw on screen.
String defines a graphical 2D text, that can be drawn on screen.
VideoMode defines a video mode (width, height, bpp, frequency) and provides static functions for gett...