Last Updated
September 27, 2012
Simple and Fast Multimedia Library
SFML (Simple and Fast Multimedia Library) is a portable and easy-to-use API for multimedia programming. We will be using this library for the follow functionality;
- Windowing (createing and managing windows)
- Input
- Loading graphical resources
- Memory management
- Framework to support OpenGL (advanced 3D graphics)
- Framework to support FMod (advanced 3D audio)
Installing SFML (need to do this only once)
- Download version 2.1 (32-bit for Visual Studio 2012) from here. Save the SFML-2.1 folder to your C:\ Drive.
- Edit your PC's 'PATH' variable to allow you app to find the SFML DLL's
- From the desktop, right-click My Computer and click Properties.
- In the System Properties window, click on the Advanced tab.
- In the Advanced section, click the Environment Variables button.
- Finally, in the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button. Add the path "C:\SFML-2.1\bin" to the end of the system path variable. Remember to put a semi-colon (;) between the directories.
-
Create a new Environment Variable called SFML_SDK, set it's value to also be the SFML directory e.g. "C:\SFML-2.1\"
Building a Visual Studio 2012 project to use SFML &OpenGL
Create a new "Win32 Console Application" Project.
Make the following changes to project properties (see screen-shot)
- select "VC++ Directories"
- select "all configurations"
- add "$(SFML_SDK)\include" to the list of include directories
- add "$(SFML_SDK)\lib" to the list of library directories
- Finally, delete the contents of your cpp file and paste in the code below (double click on the code to select);
- Press F5 to build and run...
© Ken Power 2011