Preparations for rendering
It's safe to say that all of this functionality is a bit beyond the scope of SFML, as it seeks to deal with simple two-dimensional concepts. While we're still going to be using SFML to render our sprites, the lighting and shadowing of the scene will have to fall back on raw OpenGL. This includes setting up and sampling cubemap textures, as well as creating, uploading, and drawing 3D primitives used to represent objects that cast shadows.
Representing shadow casters
While SFML is great for rendering sprites, we must remember that these are two-dimensional objects. In 3D space, our character would literally be paper thin. This means that all of our game's shadow casters are going to need some 3D geometry behind them. Keep in mind that these basic rendering concepts have already been covered in Chapter 7 , One Step Forward, One Level Down - OpenGL Basics. Let's start by creating some common definitions that this system will use:
static const glm::vec3 CubeMapDirections...