I am currently learning SFML, and I have this bit of code in my program:
if (!texture.loadFromFile("Textures/plane.png")) { std::cout << "Error loading texture plane.png" << std::endl; }
and I have a plane.png file inside the Textures folder, which are in the same folder as the executable. When I run the executable through Windows Explorer, the texture loads without any problems, but when I run it as debugging inside VS, I get this output:
Failed to load image "Textures/plane.png". Reason: Unable to open file Error loading texture plane.png
The first line is from SFML, the second is from my program.
Is there any way to fix this? I also tried putting the texture folder in several different places in the root folder of the projects, but no changes.
source share