Textures are important, both for 2D and 3D games. They allow us to map images onto objects. In this chapter, we will look into ways of loading textures into memory and mapping them onto shapes. The
Sprite class will make an appearance, and we will see how it differs from the
Shape class. Finally, we will see how to keep resources safe from destruction throughout the lifetime of the game.
In this chapter, we will cover:
Textures are quite simple objects. A 2D texture is essentially an image that is typically stored in the Graphics Processing Units' (GPU) memory. SFML provides an
Image and a
Texture class to process ...