So, on Arch Linux your installation command will look like this: $ sudo pacman -S mesa libsndfile libxrandr openal glew freetype2 libx11 It is therefore a good idea to append the mesa package (an open-source implementation of the OpenGL specification) to your installation command to ensure this dependency is satisfied. You will also discover that SFML depends on an OpenGL back-end to perform graphics rendering if you read some of the online documentation. On Arch Linux this is achieved by invoking pacman with the information flag: # Use your package manager to identify SFML dependencies $ pacman -Si sfml -| Depends On : libsndfile libxrandr openal glew freetype2 libx11 We can find out these package names by querying the SFML package that the package manager points to. The exact name of the package you will need to install for each dependency will vary depending on the package manager you are using. While it is not necessary to memorize each individual dependency, it is certainly useful to be aware of some back-end libraries SFML uses in its APIs: The official SFML website provides a general list of project names whose libraries are required to install SFML. The first step for getting SFML on a Linux system is to install a few libraries it depends on along with their development headers. For example, pacman identifies the sfml package on Arch Linux: $ pacman -Ss sfml -| community/sfml 2.5.1-2 A simple, fast, cross-platform, and object-oriented multimedia API Installing SFML Dependencies It is therefore a good idea to find out the name of the SFML package that your package manager points to. We will, however, use the package manager as an inspection tool to discover SFML’s dependencies. With these points in mind, I recommend installing SFML with CMake whilst knowing that a pre-configured package is available if a system issue prevents you from completing the manual approach. Install a local copy of the documentation files.Specify custom install locations for generated artifacts.Select specific example projects to generate.Install SFML modules as only static libraries or only shared libraries.For example, a pre-configured package won’t allow you to do things like: While convenient, this installation approach strips away your ability to customize an SFML build that matches your exact specifications. It is worth pointing out that your distribution’s package manager probably provides an SFML package which will automatically install the SFML libraries for you. This section details how to download, build and install the SFML project to your Linux system. Both projects link to SFML libraries and include a CMake configuration file for handling the build and install phases. More specifically, we will look at a minimal boilerplate project in addition to a pong game. With that said, we will focus on building SFML projects with CMake on Linux in this article to keep things simple. This means we can use an identical configuration script to compile an SFML project on Linux, Mac OS and Windows. Because the CMake program is a cross-platform build system generator, it is possible to configure how a project is built in a platform agnostic way. On the other hand, this article demonstrates how to configure SFML projects using CMake. The process of configuring a project will therefore be different depending on the IDE you use. This approach usually involves opening a dialog box to set search paths for libraries and header files, as well as specifying the actual library names an application will link to. Good examples of such IDEs are Codeblocks, Xcode and Visual Studio. The traditional approach for developing SFML applications is to use an IDE that provides graphical tools to configure a project. Once SFML is installed, we will switch our focus to developing applications that use its libraries. We then copy these artifacts to standard locations on the file system to complete an installation. This process involves downloading the official SFML GitHub repository and using CMake to configure a build environment for generating artifacts such as the project’s shared libraries, header files and example projects. The first part of this article details how to install SFML on Linux using CMake. It is also very accessible for smaller teams and hobbyists who are new to the realm of developing games and multimedia applications with C++. SFML can facilitate the development of large-scale commercial game projects. Several language bindings also exist for many popular programming languages. On top of this, SFML is written in C++ and provides an easy-to-use C++ interface. The project is also working towards being able to compile Android and iOS applications out of the box. SFML can compile and run on Linux, Mac OS and Windows. The Simple and Fast Multimedia Library (SFML) is a cross-platform development library that provides simple APIs for creating games and multimedia applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |