Table of Contents The installation steps of the SFML graphics library are as follows: 1. Download SFML from the official website of SFML (download the SFML corresponding to the operating system version). ?edit 2. Unzip the file. Unzip the downloaded compressed package to any location to obtain a directory structure similar to the following: 3. […]
Tag: sfml
SFML2.6 graphics module–sprites and textures
Glossary Most, if not all, of you are already familiar with these two very common objects, so let’s briefly define them. Textures are pictures. But we call it a “texture” because it has a very specific purpose: to be mapped onto a 2D entity. Sprites are nothing but textured rectangles. Okay, that’s short, but if […]
SFML2.6 graphics module–add special effects using shaders
Introduction Shaders are small programs that execute on the graphics card. It provides more flexible and simpler control of the drawing process than using the fixed states and operations provided by OpenGL. With this additional flexibility, shaders are used to create effects that are too complex or impossible to describe using regular OpenGL functions: pixel-level […]
SFML2.6 graphics module–designing entities with vertex arrays
Introduction SFML provides simple classes to represent the most common 2D entities. While more complex entities can be easily created from these basic components, this is not always the most efficient solution. For example, if you draw a large number of sprites, you will quickly reach the limits of your graphics card. The reason is […]
SFML2.6 starts–compile SFML with CMake
Introduction Admittedly, the title of this tutorial is a bit misleading. You won’t use CMake to compile SFML because CMake is not a compiler. So…what is CMake? CMake is an open source meta-build system. It doesn’t build SFML, it builds the things that build SFML: Visual Studio solutions, Code::Blocks projects, Linux makefiles, XCode projects, etc. […]
SFML2.6 graphics module–position, rotation, scaling: entity transformation
Transform SFML entities All SFML classes (sprites, text, shapes) use the same interface for transformation: sf::Transformable. This base class provides a simple API to move, rotate and scale your entities. It does not provide maximum flexibility, but defines an interface that is easy to understand and use, covering 99% of all use cases – for […]
SFML2.6 graphics module–using views to control 2D cameras
What is a view? In games, it’s common to have levels that are much larger than the window. You can only see a small part of it. This is usually the case with RPGs, platformers, and many other types. What developers may forget is that they are defining entities in a 2D world, not directly […]
[Solved] About the error of SFML Rect.inl file
First, there is a conflict between the parameter templates of max and min because of the max and min macros of VC++ So add #undef max and #undef min in front to cancel the macro definition Then the Rect template is under the sf namespace, but the file does not prefix Rect with sf:: The […]