Note that this code is wrong:
if (!texture.loadFromFile("/assets/textures/image.jpg"))
std::cout << "\nFailed loading texture.\n";
return EXIT_FAILURE;
without indentation it means:
if (!texture.loadFromFile("/assets/textures/image.jpg"))
std::cout << "\nFailed loading texture.\n";
return EXIT_FAILURE;
So it would also just exit your application.
I'm personally a fan of using curly braces at all times, even or especially for single line statements:
if (!texture.loadFromFile("/assets/textures/image.jpg"))
{
std::cout << "\nFailed loading texture.\n";
return EXIT_FAILURE;
}
Note the same issue for the music