Since we have our TextureHolder
class, we might as well be consistent and use it to load all our textures. Let's make some very small alterations to the existing code that loads textures for the background sprite sheet and the player.
In the ZombieArena.cpp
file, find this code:
// Load the texture for our background vertex array
Texture textureBackground;
textureBackground.loadFromFile("graphics/background_sheet.png");
Delete the code highlighted previously and replace it with the following highlighted code, which uses our new TextureHolder
class:
// Load the texture for our background vertex array
Texture textureBackground = TextureHolder::GetTexture(
"graphics/background_sheet.png");